This differs little from your description on page 11 of
I don't think we should allow the user to have a
argument 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
x = lm(x,y)
waitThread(interval, Quote(x = lm(x,y)))
This is a small point, but it seems more intuitive to not have
Quote in 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.
onExit = NULL,
Note that many of the arguments are document from the
thread() documentation since this
class (waitThread) inherits from
- the expression that will be evaluated
when the timer expires. This is any expression
is as usual for newly created
- the number of seconds to wait until the timer expires.
At the end of this time (approximately), the thread
will evaluate expression.
If this length of this object is greater than 1
and is of mode
the values are treated as successive intervals
between repeated evaluations of the same
action/task supplied in
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.
- this can be specified either as a numeric value denoting
an interval or as a logical value.
- logical - if true, automatically reschedule the
expression to be evaluated every interval
seconds. If the value is false,
the expression is evaluated once. The expression can
- numeric value - this is interpreted as the
delay to use between successive evaluations
The timer is automatically rescheduled each time to expire
after this length of time.
If the argument interval is missing
and repeat is specified as a numeric value,
this is also used for the initial interval.
- I am not sure we want to do this, but semantically it is ok!
list of numeric values -
the thread reschedules expression
to be evaluated this number of times. The interval between
the ith and (i+1)th evaluation
is the ith vaue in the list.
Again, if interval is not supplied
and this is, this is used for scheduling in what I think
is the obvious way. (i.e. the first time it goes off is after
repeat[] seconds, and then
- See access
for a description of the purpose of this argument.
Note that, by default, we allow no other thread to
have tasks evaluated by this thread through
- A thread is created and managed by the evaluator
Last modified: Mon Feb 10 16:37:14 1997