Create an activity that throws a TimeoutError once a timeout is
reached
e.g. starting(someStartable, timeoutAfter(2000, "whoops!")).task() will
create a task that terminates with a new TimeoutError("whoops!") if
someStartable doesn't complete in under 2 seconds.
Or, to asyncThrow from inside a task, just start(timeoutAfter(...)) in the
task's body, or work.exec(timeoutAfter(...)). (If you need a resettable
deadline, use watchdog() instead.)
Create an activity that throws a TimeoutError once a timeout is reached
e.g.
starting(someStartable, timeoutAfter(2000, "whoops!")).task()will create a task that terminates with anew TimeoutError("whoops!")ifsomeStartabledoesn't complete in under 2 seconds.Or, to asyncThrow from inside a task, just
start(timeoutAfter(...))in the task's body, orwork.exec(timeoutAfter(...)). (If you need a resettable deadline, use watchdog() instead.)