-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e467404
commit 34f932b
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from scenes.Signal import SignalHandlerWorkflow | ||
from tempyral.application import Application | ||
from tempyral.simulation import Simulation, run_simulation | ||
|
||
|
||
class SignalWithStartApplication(Application): | ||
""" | ||
An application that starts a workflow via SignalWithStart. | ||
""" | ||
|
||
typescript = """ | ||
const wfHandle = await client.signalWithStart(myWorkflow, { // tempyral: ApplicationRequestType.SignalWithStartWorkflow "my-workflow-id" | ||
workflowId: 'my-workflow-id', | ||
signal: myIncrementer, | ||
signalArgs: [1], | ||
taskQueue: 'my-tast-queue', | ||
}); | ||
await wfHandle.result() // tempyral: ApplicationRequestType.GetWorkflowResult "my-workflow-id" | ||
""" | ||
|
||
|
||
class SignalWithStart(Simulation): | ||
application_classes = [SignalWithStartApplication] | ||
workflow_classes = [SignalHandlerWorkflow] | ||
|
||
|
||
if __name__ == "__main__": | ||
run_simulation(SignalWithStart()) |
Oops, something went wrong.