-
Notifications
You must be signed in to change notification settings - Fork 111
new fields in rpcInvokeReqExtra #1508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
runtime-light/tl/tl-types.h
Outdated
| // ===== RPC ===== | ||
|
|
||
| namespace exactlyOnce { | ||
| class Uuid final { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, check current approach for type naming in the tl namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| bool fetch(tl::fetcher& tlf) noexcept { | ||
| bool ok{fields_mask.fetch(tlf)}; | ||
|
|
||
| if (ok) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just ok = ok && trace_id.fetch()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not the case we had discussion about, but I it's to keep it as it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, done
|
|
||
| array out{std::pair{underline, mixed{}}, | ||
| std::pair{string{persistent_query_uuid_sv.data(), static_cast<string::size_type>(persistent_query_uuid_sv.size())}, mixed{}}, | ||
| std::pair{string{persistent_slot_uuid_sv.data(), static_cast<string::size_type>(persistent_slot_uuid_sv.size())}, mixed{}}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have an empty persistent_slot_uuid in the prepareRequest case? I think it would be more correct for it to be absent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| constexpr std::string_view lo_sv = "lo"; | ||
| constexpr std::string_view hi_sv = "hi"; | ||
|
|
||
| const auto underline = string{"_", 1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: include please string header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
runtime/interface.cpp
Outdated
|
|
||
| array out{std::pair{underline, mixed{}}, | ||
| std::pair{string{persistent_query_uuid_sv.data(), static_cast<string::size_type>(persistent_query_uuid_sv.size())}, mixed{}}, | ||
| std::pair{string{persistent_slot_uuid_sv.data(), static_cast<string::size_type>(persistent_slot_uuid_sv.size())}, mixed{}}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for runtime-light
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| constexpr std::string_view lo_sv = "lo"; | ||
| constexpr std::string_view hi_sv = "hi"; | ||
|
|
||
| const auto underline = string{"_", 1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use braced init, please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
|
||
| const auto underline = string{"_", 1}; | ||
|
|
||
| array out{std::pair{underline, mixed{}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may eliminate one array lookup here. To do that, create and set the array directly in if branches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| [&superglobals](const auto& value) noexcept { | ||
| using value_t = std::remove_cvref_t<decltype(value)>; | ||
|
|
||
| constexpr std::string_view exactlyOnce_prepareRequest_sv = "exactlyOnce.prepareRequest"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no actual need for _sv suffix
| extra.opt_persistent_query->request); | ||
| } | ||
| if (extra.opt_trace_context) { | ||
| const auto& trace_context{*extra.opt_trace_context}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let's not mix -> and * operators of std::optional. Just choose one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| constexpr std::string_view debug_flag_sv = "debug_flag"; | ||
|
|
||
| array out{ | ||
| std::pair{string{"_", 1}, mixed{string{tracing_traceContext_sv.data(), static_cast<string::size_type>(tracing_traceContext_sv.size())}}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: here you don't create a constant for underscore, but you do that above, why?
btw it's called underscore, not underline
| out.set_value(string{source_id_sv.data(), static_cast<string::size_type>(source_id_sv.size())}, | ||
| string{opt_source_id_value.data(), static_cast<string::size_type>(opt_source_id_value.size())}); | ||
| } | ||
| if (trace_context.reserved_status_0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this won't work when you try to use out array in further RPC calls. It should not contain these flags. It only needs to contain fields mask
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed
added:
persistent_query,trace_context,execution_context