DRAFT
The idler functionality in Ecore allows for callbacks to be called when the program isn't handling events, timers or fd handlers.
There are three types of idlers: Enterers, Idlers(proper) and Exiters. They are called, respectively, when the program is about to enter an idle state, when the program is in an idle state and when the program has just left an idle state and will begin processing events, timers or fd handlers.
Enterer callbacks are good for updating your program's state if it has a state engine. Once all of the enterer handlers are called, the program will enter a “sleeping” state.
Idler callbacks are called when the main loop has called all enterer handlers. They are useful for interfaces that require polling and timers would be too slow to use.
Exiter callbacks are called when the main loop wakes up from an idle state.
If no idler callbacks are specified, then the process literally goes to sleep. Otherwise, the idler callbacks are called continuously while the loop is “idle”, using as much CPU as is available to the process.
Syntax
function mycallback() { ... }; var idler = efl.Ecore.Idle.add(mycallback);
Parameters
Return value
Add an idler handle to the event loop, returning a handle on success and NULL otherwise. The function callback
will be called repeatedly while no other events are ready to be processed, as long as it returns 1 (or efl.Ecore.Mainloop.CALLBACK_RENEW
). A return of 0 (or efl.Ecore.Mainloop.CALLBACK_CANCEL
) deletes the idler.
Syntax
function mycallback() { ... }; var idler = efl.Ecore.Idle.addEnterer(mycallback);
Parameters
Return value
Add an idle enterer handler.
efl.Ecore.Mainloop.CALLBACK_RENEW
). A return of 0 (or efl.Ecore.Mainloop.CALLBACK_CANCEL
) deletes the idle enterer.
Syntax
function mycallback() { ... }; var idler = efl.Ecore.Idle.addEntererBefore(mycallback);
Parameters
Return value
Add an idle enterer handler at the start of the list so it gets called earlier than others.
efl.Ecore.Mainloop.CALLBACK_RENEW
). A return of 0 (or efl.Ecore.Mainloop.CALLBACK_CANCEL
) deletes the idle enterer.
Syntax
function mycallback() { ... }; var idler = efl.Ecore.Idle.addExiter(mycallback);
Parameters
Return value
Add an idle exiter handler.
efl.Ecore.Mainloop.CALLBACK_RENEW
). A return of 0 (or efl.Ecore.Mainloop.CALLBACK_CANCEL
) deletes the idle exiter.
Syntax
idlerObj.del();
Deletes an idler from the list of active idlers.