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

Add strongly-typed extension methods for SignalWithStart #269

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Blackburn29
Copy link

What was changed

Added extension methods for calling signalWithStart.

Why?

Adds support for strong typings when starting a workflow with a signal.

Currently this requires holding a second variable for WorkflowOptions and calling
options.SignalWithStart(x => x.Method()).

These extension methods give you the ability to short-hand the setup:

var handle = await _temporalClient.SignalWorkflowWithStartAsync(
    workflow => workflow.RunAsync(),
    workflow => workflow.SignalMethod(),
    new WorkflowOptions
    {
       //...
    });

Checklist

  1. Closes
    N/A

  2. How was this tested:
    I have been using these extension methods in some of my applications for awhile, but I figured they would be useful to others.

  3. Any docs updates needed?
    N/A

@CLAassistant
Copy link

CLAassistant commented Jun 7, 2024

CLA assistant check
All committers have signed the CLA.

@cretz
Copy link
Member

cretz commented Jun 7, 2024

We may have future things like update with start and so we decided in newer SDKs that extra things on start are just options, so I am not sure we want to provide top-level shortcuts to save creating options in this case, but we of course support users doing so like you've done here.

As potential new multi-operation RPC calls come about some of this design may change. But if they don't change this much, we can merge this shortcut. But I think we want to wait on it to see those designs.

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

3 participants