John:
This differs little from your description on page 11 of event.ps. I don't think we should allow the user to have athreadargument that can make the call refer to self(). This is what sleep is for. I can see the consistency argument, but the name suggests something different. We would have objects of class waitThread and a function that didn't necessarily create one! It is not a big deal, but it seems more intuitive to keep sleep() as sleep and this to do things asynchronously. Also, if the target thread is self(), we could just dosleep(interval) x = lm(x,y)rather thanwaitThread(interval, Quote(x = lm(x,y)))This is a small point, but it seems more intuitive to not haveQuotein there.
Also, it might be better to hide the word Thread unless multiple threads are in existence. For example
waitThread - create a
waitThread object which performs a task after a specified
interval. Optionally, the task can be automatically rescheduled
or the task can reschedule another task. The object created
is of class waitThread which
inherits from the thread class.
Note that many of the arguments are document from the thread() documentation since this class (waitThread) inherits from class thread.
numeric
the values are treated as successive intervals
between repeated evaluations of the same
action/task supplied in
expression.
This allows the user to repeat a task a given number of
times with different intervals between each iteration.
See also the repeat
argument for more details.
repeat[[1]] seconds, and then repeat[[2]]
seconds, etc.)