alert-oil-1341
10/07/2024, 2:45 PM@workflow
def locking_wf() -> None:
acquired, lock_handle = acquire_lock(lock_handle="my_lock", duration_in_seconds=10)
cond = (
conditional("test lock")
.if_(acquired.is_true())
.then(task1(lock_handle))
.else_()
.then(task2())
)
cond > release_lock(lock_handle=lock_handle)
Where acquire_lock
and release_lock
are Agents responsible for maintaining the lock. Curious if others have similar use-cases and or implementations?damp-lion-88352
10/07/2024, 2:46 PMdamp-lion-88352
10/07/2024, 2:47 PMdamp-lion-88352
10/07/2024, 2:47 PMalert-oil-1341
10/07/2024, 2:51 PMalert-oil-1341
10/07/2024, 2:52 PMalert-oil-1341
10/07/2024, 2:54 PMtask2()
is probably an echo(message="noop")
or somethingalert-oil-1341
10/07/2024, 2:55 PMfreezing-airport-6809
alert-oil-1341
10/07/2024, 4:31 PM