Skip to content

Resolve "What is `bliss.common.task.task` for?"

Matias Guijarro requested to merge 3214-what-is-bliss-common-task-task-for into master

Closes #3214 (closed)

Removal of the task decorator.

The decorated method can be executed in three ways:
    1. Synchronous execution without timeout (the default)
    2. Synchronous execution with timeout (`wait=True, timeout=...`)
    3. Asynchronous execution (`wait=False`, `timeout` is ignored)
       Returns an asynchronous result handler of type `Greenlet`.

The argument `wait_started=True` can be used in case 2 and 3 to
wait for the task to start before the timeout period starts (2)
or the asynchronous result handler is returned (3).

This decorator was used at two places with wait=False (neither wait_started nor timeout was used).

In other words it can be replaced in both cases by a simple gevent.spawn.

The temperature module did use an event which basically does what wait_started=True would have done so I kept it.

Edited by Wout De Nolf

Merge request reports