Skip to content

Prep for stable API #42

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

Merged
merged 4 commits into from
Feb 5, 2025
Merged

Prep for stable API #42

merged 4 commits into from
Feb 5, 2025

Conversation

@bergundy bergundy merged commit 37755b4 into nexus-rpc:main Feb 5, 2025
3 checks passed
@bergundy bergundy deleted the context-links branch February 5, 2025 21:48
// Can be called from an [Operation] handler Start method or from a [Handler] StartOperation method. The context
// provided must be the context passed to the handler. This method may be called multiple times for a given handler,
// each call appending additional links. Links will only be attached on successful responses.
func AddHandlerLinks(ctx context.Context, links ...Link) {
Copy link

@cretz cretz Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should be able to see links that exist, remove links, etc. I would recommend at least a getter and setter (though access to a structure that contains links as a field may be better, but I understand the thread safety fear even if I don't share it). Feel free to make the getter copy the slice before returning. You can keep add in addition to set if you'd like, though you may want to call it "append", your choice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I already merged, I can address in a followup PR if needed.

I think it's okay to expose a simple API for now, following https://pkg.go.dev/google.golang.org/grpc#SetHeader, and add more functionality later.

bergundy added a commit that referenced this pull request Feb 6, 2025
#44)

Follow up to #42, this is so we can use `AddHandlerLinks` in the
Temporal SDK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants