Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Task & Timer GClasses

Async task execution, timers, and counters.

Source: kernel/c/root-linux/src/c_task.c, c_timer.c, c_timer0.c, c_counter.c


C_TASK

Task execution engine — orchestrates multi-step jobs with timeout and result handling.

PropertyValue
StatesST_STOPPED, ST_IDLE, ST_WAIT_RESPONSE
Input eventsEV_ON_MESSAGE, EV_TIMEOUT, EV_STOPPED
Output eventsEV_ON_MESSAGE

Key attributes

AttributeTypeDescription
jobsjsonJob definitions (array of steps).
input_datajsonInput data for jobs.
output_datajsonCollected output data.
gobj_jobspointerGobj that executes jobs.
gobj_resultspointerGobj that receives results.
timeoutintegerAction timeout in seconds.

C_TIMER

High-level timer — recommended for general use. Uses periodic yuno events with millisecond configuration. See the Timer API for helper functions.

PropertyValue
StatesST_STOPPED, ST_IDLE
Output eventsEV_TIMEOUT

Key attributes

AttributeTypeDescription
periodicboolTRUE for recurring, FALSE for one-shot.
msecintegerTimeout / interval in milliseconds.
subscriberpointerGobj receiving EV_TIMEOUT.

Notes


C_TIMER0

Low-level timer — uses io_uring directly. Each instance opens a file descriptor. Prefer C_TIMER unless you need lower-level control.

PropertyValue
StatesST_STOPPED, ST_IDLE
Output eventsEV_TIMEOUT

Key attributes

Same as C_TIMER.

Notes


C_COUNTER

Event counter — tracks incoming events until reaching a target count or a timeout, then fires a final event.

PropertyValue
StatesST_STOPPED, ST_IDLE, ST_WAIT_COUNT
Input eventsEV_ON_MESSAGE, EV_TIMEOUT
Output eventscustom (final_event_name)

Key attributes

AttributeTypeDescription
max_countintegerTarget event count.
expiration_timeoutintegerTimeout in seconds (fires even if count not reached).
final_event_namestringEvent name to fire on completion.
input_schemajsonSchema for counted events.