Adds a function to be called whenever there are no higher priority events pending.
If the function returns false it is automatically removed from the list of event sources and will not be called again.
This internally creates a main loop source using IdleSource and attaches it to the main loop context using attach. You can do these steps manually if you need greater control.
priority |
the priority of the idle source. Typically this will be in the range between DEFAULT_IDLE and HIGH_IDLE. |
function |
function to call |
data |
data to pass to |
notify |
function to call when the idle is removed, or null |
the ID (greater than 0) of the event source. |