-
Notifications
You must be signed in to change notification settings - Fork 0
@wait
@wait
command: @wait[/until] <seconds>=<command> @wait[/until] <object>[/<seconds>]=<command> @wait <object>/<attribute>=<command>
generally, @wait defers the execution of <command> until some future condition or combination of conditions.
the first form of @wait executes <command> at some future time.
the second form executes <command> when the object's semaphore is notified. if <seconds> is specified in this second form, <command> is executed at some future time even if the object's semaphore isn't notified. this is sometimes referred to as a 'timeout'.
the third form allows the use of an attribute other than 'semaphore'. it allows multiple sets of semaphore-blocked commands to use the same object.
this command charges a deposit of 10 coins which is refunded when <command> is executed or otherwise leaves the queue.
by default, <seconds> is relative to the time @wait is processed, however if /until used, <seconds> is taken as absolute (see secs, convtime and convsecs). <seconds> can also express fractional seconds.
examples: > @wait 2.001=think foobar foobar > think secs() 1004732313 > @wait/until 1004732400.5=think foobar foobar > @dolist [setq(0,iadd(secs(),2))]75 0 25=@wait/until %q0.##=think ## 0 25 75
related topics: @drain, @notify, @ps, semaphores, secs, convtime, convsecs.