Tasker: vtk_tasker_set_timeleft
This procedure is used in the context of time-variant tasker resources. It takes a single non-negative argument, which is interpreted as the maximum expected duration for a job to be dispatched to the tasker.
For example, if a tasker does not want to accept jobs longer than
2 minutes, it will say:
namespace eval VovResources {
proc SmallJobsOnly {} {
vtk_tasker_set_timeleft 2m
return "@STD@"
}
}
The argument of vtk_tasker_set_timeleft
is one of:
- The string "UNLIMITED", meaning that the tasker accepts jobs of any length
- A positive integer
- A time specification
- The number 0, in which case the tasker is effectively suspended, because it does not accept any job
...
# -- During the day, suspend the tasker.
vtk_tasker_set_timeleft 0
...
Quantization of "timeleft" and "xdur"
For efficiency of the server-tasker messaging interface, all
finite values passed to vtk_tasker_set_timeleft
are silently quantized to the next largest level according to the following table:
Time Left | Quantized value |
---|---|
0-60s | Round up to the next multiple of 5s |
60s-30m | Round up to the next multiple of 1m |
30m-1h | Round up to the next multiple of 2m |
1h-3h | Round up to the next multiple of 5m |
3h-6h | Round up to the next multiple of 10m |
6h+ | Round up to the next multiple of 30m |