flux.core.watchers module

class flux.core.watchers.CheckWatcher(flux_handle, callback, args=None)

Bases: Watcher

Watcher that fires once per reactor iteration, after blocking.

Fires just after the event loop returns from backend_poll, before I/O callbacks from the current poll are dispatched. Typically paired with a PrepareWatcher and an IdleWatcher; see PrepareWatcher for the pattern.

class flux.core.watchers.FDWatcher(flux_handle, fd_int, events, callback, args=None)

Bases: Watcher

class flux.core.watchers.IdleWatcher(flux_handle, callback=None, args=None)

Bases: Watcher

Watcher that prevents the event loop from blocking.

When active, keeps backend_poll from sleeping so that the loop spins without waiting for I/O. Typically used without a callback (pass callback=None) as part of the prepare/idle/check pattern: the prepare watcher starts this watcher when there is work pending, and the check watcher stops it after the work is done.

class flux.core.watchers.SignalWatcher(flux_handle, signal_int, callback, args=None)

Bases: Watcher

class flux.core.watchers.TimerWatcher(flux_handle, after, callback, repeat=0, args=None)

Bases: Watcher

reset(after=None, repeat=None)

Reset the timer and restart it.

Updates the timer values and re-arms it from scratch, even if it is already running. Parameters default to the values passed at creation.