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

Clarification of Go Handlers/Selectors #3306

Open
1 task done
joshmsmith opened this issue Jan 27, 2025 · 2 comments
Open
1 task done

Clarification of Go Handlers/Selectors #3306

joshmsmith opened this issue Jan 27, 2025 · 2 comments
Labels
waiting-on-ticket The issue has been received but has not yet been ticketed or triaged

Comments

@joshmsmith
Copy link

Temporal Affiliation

  • I am a Temporal employee

Content Suggestion

In Go, there was some confusion about if Futures run even if you don't Select() but the docs say:

selector.Select(ctx) is the primary mechanism which blocks on and executes Future work. It is intentionally flexible; you may call it conditionally or multiple times

This seems to conflict with other docs that say things like "ExecuteActivity requests activity execution in the context of a workflow...ExecuteActivity immediately returns a Future that can be used to block waiting for activity result or failure."

So does the Select() let you block while the activity runs or does it actually execute the activity?

I was sure it's nothing runs until you call selector.Select(ctx) from this comment:
// API Example: block until the next Future is ready to run
// important! none of the deferred code runs until you call selector.Select
This was confirmed by testing I did today.
But my pause is about the docs which say "request execution". It seems it might be more clear if it says "requests execution to be done upon get() or select()".
I think that could be a good clarification.
more discussion here

@fairlydurable
Copy link
Contributor

Thanks, Josh. Will get this into the system.

@fairlydurable fairlydurable added the waiting-on-ticket The issue has been received but has not yet been ticketed or triaged label Jan 27, 2025
@GSmithApps
Copy link
Contributor

Commenting here so GitHub sees me as involved. Please forgive me for the extra notification 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-ticket The issue has been received but has not yet been ticketed or triaged
Projects
None yet
Development

No branches or pull requests

3 participants