File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from temporalio import activity
22
3+
34@activity .defn ()
45async def greeting (name : str ) -> str :
5- return f"Hello { name } !"
6+ return f"Hello { name } !"
Original file line number Diff line number Diff line change 99
1010TASK_QUEUE = "eager-wf-start-task-queue"
1111
12+
1213async def main ():
13-
14+
1415 # Note that the worker and client run in the same process and share the same client connection.
1516 client = await Client .connect ("localhost:7233" )
1617 worker = Worker (
@@ -30,7 +31,7 @@ async def main():
3031 task_queue = TASK_QUEUE ,
3132 request_eager_start = True ,
3233 )
33-
34+
3435 # This is an internal flag not intended to be used publicly.
3536 # It is used here purely to display that the workflow was eagerly started.
3637 print (f"Workflow eagerly started: { wf_handle .__temporal_eagerly_started } " )
Original file line number Diff line number Diff line change 33from temporalio .client import Client
44from temporalio .worker import Worker
55
6- from eager_wf_start .workflows import EagerWorkflow
76from eager_wf_start .activities import greeting
7+ from eager_wf_start .workflows import EagerWorkflow
8+
89
910async def test_eager_wf_start (client : Client ):
1011 task_queue_name = str (uuid .uuid4 ())
@@ -25,4 +26,4 @@ async def test_eager_wf_start(client: Client):
2526 print ("HANDLE" , handle .__temporal_eagerly_started )
2627 assert handle .__temporal_eagerly_started
2728 result = await handle .result ()
28- assert result == "Hello Temporal!"
29+ assert result == "Hello Temporal!"
You can’t perform that action at this time.
0 commit comments