Skip to content

Commit a31e605

Browse files
YunchuWangCopilot
andcommitted
Simplify on-demand sandbox worker sample wait
Replace the manual sleep loop with a blocking wait so the sample keeps the process alive without suggesting worker polling behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f79b78b commit a31e605

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

examples/on_demand_sandbox/remote_worker.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Remote worker image entrypoint for the Durable Task Scheduler on-demand sandbox activities sample."""
22

33
import os
4-
import time
4+
import threading
55

66
from durabletask import task
77
from durabletask.azuremanaged.preview.on_demand_sandbox import OnDemandSandboxWorker
@@ -24,7 +24,6 @@ def _remote_hello(ctx: task.ActivityContext, name: str) -> str:
2424
worker.start()
2525
print("Python on-demand sandbox remote worker is running. Press Ctrl+C to stop.")
2626
try:
27-
while True:
28-
time.sleep(3600)
27+
threading.Event().wait()
2928
except KeyboardInterrupt:
3029
pass

0 commit comments

Comments
 (0)