Skip to content

Async activity Invocation Example in Go#286

Open
edmondop wants to merge 4 commits intotemporalio:mainfrom
edmondop:async-activity
Open

Async activity Invocation Example in Go#286
edmondop wants to merge 4 commits intotemporalio:mainfrom
edmondop:async-activity

Conversation

@edmondop
Copy link
Copy Markdown
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?

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Member

mfateev commented Jun 21, 2023

Copy link
Copy Markdown
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
Copy Markdown
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