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

Added ability to call method activities by function pointer #96

Merged
merged 1 commit into from
Apr 10, 2020

Conversation

mfateev
Copy link
Member

@mfateev mfateev commented Apr 10, 2020

Makes possible the following trick:

type Activities struct {
...
}

func (a *Activities) RetryTimeoutStableErrorActivity() error {
...
}

And inside the workflow:

	var a *Activities
	err := workflow.ExecuteActivity(ctx, a.RetryTimeoutStableErrorActivity).Get(ctx, nil)

This is possible as Go allows nil function receivers.

@mfateev mfateev merged commit 4ea2679 into temporalio:master Apr 10, 2020
@mfateev mfateev deleted the execute_by_method_ref branch April 10, 2020 16:40
muralisrini pushed a commit to muralisrini/sdk-go that referenced this pull request Feb 4, 2024
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.

None yet

2 participants