Skip to content
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

Async activity Invocation Example in Go #286

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

edmondop
Copy link
Contributor

What was changed

This adds an example of a non-blocking invocation of two activities in Go, with a behavior coherent with the Java example here
https://github.com/edmondop/samples-java/blob/main/src/main/java/io/temporal/samples/hello/HelloAsync.java#L114

Why?

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

README.md Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Add this example to the example list

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed with a063d6c

err = future.Get(ctx, &res2)
})
selector.Select(ctx)
selector.Select(ctx)
Copy link
Member

Choose a reason for hiding this comment

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

If an err was reported by the first select, you have swallowed it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed with 7156e31

@edmondop edmondop requested a review from cretz June 12, 2023 22:59
@mfateev
Copy link
Member

mfateev commented Jun 21, 2023

Copy link
Member

@mfateev mfateev left a comment

Choose a reason for hiding this comment

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

@edmondop
Copy link
Contributor Author

This use case is already covered by existing samples:

https://github.com/temporalio/samples-go/tree/main/splitmerge-selector https://github.com/temporalio/samples-go/tree/main/splitmerge-future

Thanks! Didn't know those examples! If this pattern is what match more closely the Java async examples, maybe we can just update the README ?

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