-
Notifications
You must be signed in to change notification settings - Fork 68
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
Nexus callbacks, tasks, and incoming service registry #352
Conversation
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 assume Nexus operation events come later?
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.
Yeah, we're not quite there yet in terms of stable implementation.
I plan to open a PR with those that will sit around for a while in a feature branch very soon.
// Callback URL. | ||
// (-- api-linter: core::0140::uri=disabled | ||
// aip.dev/not-precedent: Not following this guideline. --) | ||
string url = 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.
I forget whether this should be a URL or a service name. Aren't URLs configured as part of services and service names used in place of URLs everywhere?
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.
Callbacks use URLs.
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 know it's limited feature set only for now, but one might expect there to be a lot of config that one would want to set for callback URLs. Is that on the future radar?
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.
The config is provided via dynamic config per address.
We may allow setting headers and more customization at callback attachment time, we'll evaluate as needed.
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.
Looks good to me. I mainly think we can benefit from some more documentation. I think most of this stuff could be inferred from the code, but these are the questions that came up for me at a glance.
} | ||
|
||
message HandlerError { | ||
// See https://github.com/nexus-rpc/api/blob/main/SPEC.md#predefined-handler-errors. |
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: should this be on the message instead of the field similar to the Failure message, or is that intentional?
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.
The comment is referring to the error type.
} | ||
|
||
// A request to start an operation. | ||
message StartOperationRequest { |
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.
Do you have a link to the docs for this one as well?
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 don't know if it's strictly needed. I didn't feel like it was necessary.
// A Nexus request. | ||
message Request { | ||
// Headers extracted from the original request in the Temporal frontend. | ||
// When using Nexus over HTTP, this includes the request's HTTP headers ignoring multiple values. |
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.
ignoring multiple values.
Which values? I assume something like Temporal-but-not-Nexus-specific headers?
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.
HTTP headers can have multiple values, we only take the first one.
@@ -152,3 +153,32 @@ message NewWorkflowExecutionInfo { | |||
temporal.api.common.v1.Header header = 13; | |||
} | |||
|
|||
message CallbackInfo { |
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 a quick note about what this message is could be useful. There's a few different CallbackXXX types, and there should be some disambiguation. Like, how does this differ from temporal.api.common.v1.Callback
?
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.
Yeah, good point.
// A unique identifier for this task. | ||
bytes task_token = 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.
Is this intentionally opaque? If so, I think it'd be nice to state what its purpose is, i.e. is it for idempotency?
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.
It's common in all of our APIs. Yes, it's intentionally opaque.
It's for correlating a poll response with a completion request.
I'll add it to the docstring.
// The identity of the client who initiated this request. | ||
string identity = 2; |
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.
What is this used for? I think it'd be nice to say because there's a lot of different "identity" fields throughout our APIs, and I believe they don't always have the same behavior or purpose.
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.
It's always to the caller identity. It's likely useful only for debugging but we don't persist it, log it it or send it back to the caller.
This PR takes the work from the
nexus
feature branch and merges it intomaster
.All of this has already been reviewed in previous PRs into the
nexus
branch but now that we're making progress with the implementation and feel confident in this API, it's time to merge.