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

Improve signalWithStart usability #915

Open
Spikhalskiy opened this issue Dec 4, 2021 · 3 comments
Open

Improve signalWithStart usability #915

Spikhalskiy opened this issue Dec 4, 2021 · 3 comments

Comments

@Spikhalskiy
Copy link
Contributor

Spikhalskiy commented Dec 4, 2021

Workflow#signalWithStart method interface is overcomplicated and hard to use without checking with samples first.
We should improve the classes structure and provide more conventional builders and factory methods around this method and functionality.

@mfateev
Copy link
Member

mfateev commented Jan 23, 2022

Such refactoring should keep the strongly typed way to call this method the current implementation provides.

@tsurdilo
Copy link
Contributor

tsurdilo commented Feb 11, 2022

Wanted to suggest one possible improvement.
Currently with signalWithStart we can do for example:

WorkflowStub untyped = WorkflowStub.fromTyped(typedStub);
untyped.signalWithStart(...);

( or just create an untyped stub to start with ) so this works off just WorkflowStub (untyped)

WorkflowClient.signalWithStart only works off typed stubs, for example:

 BatchRequest request = client.newSignalWithStartRequest();
 request.add(myWorkflowStub::exec, input); // exec is workflow method
 request.add(myWorkflowStub::handleSignal, signalData); // handleSignal is a signal method
 client.signalWithStart(request);

It would be nice to add an "untyped" option for WorkflowClient.signalWithStart that takes in signalName, signalData, inputData.

Bonus question, whats the use for WorkflowClient.signalWithStart? When would you use it instead of WorkflowStub.signalWithStart?

@drewhoskins-temporal
Copy link

We've recently shipped updateWithStart in pre-release, and we hope it has better usability.
If it goes well, we'd like to make signalWithStart adopt this pattern for better usability and consistency, so please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants