Skip to content

Commit

Permalink
Implement SignalWithStart
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Jan 16, 2024
1 parent e467404 commit 34f932b
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
28 changes: 28 additions & 0 deletions scenes/SignalWithStart.py
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())

0 comments on commit 34f932b

Please sign in to comment.