Skip to content

Commit

Permalink
core: increase time delays in demo code
Browse files Browse the repository at this point in the history
  • Loading branch information
provos committed Dec 15, 2024
1 parent 480086a commit 570fca3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/planai/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ class Task1Worker(TaskWorker):

def consume_work(self, task: Task1WorkItem):
self.print(f"Task1 consuming: {task.data}")
time.sleep(random.uniform(0.2, 0.9))
time.sleep(random.uniform(0.4, 1.5))
for i in range(7):
processed = f"Processed: {task.data.upper()} at iteration {i}"
self.publish_work(
Expand All @@ -528,7 +528,7 @@ class Task2Worker(TaskWorker):

def consume_work(self, task: Task2WorkItem):
self.print(f"Task2 consuming: {task.processed_data}")
time.sleep(random.uniform(0.3, 2.5))
time.sleep(random.uniform(0.5, 2.5))

if args.run_dashboard:
# demonstrate the ability to request user input
Expand All @@ -551,7 +551,7 @@ class Task3Worker(TaskWorker):

def consume_work(self, task: Task3WorkItem):
self.print(f"Task3 consuming: {task.final_result}")
time.sleep(random.uniform(0.4, 1.2))
time.sleep(random.uniform(0.6, 1.2))
self.print("Workflow complete!")

# Create Graph
Expand Down

0 comments on commit 570fca3

Please sign in to comment.