efl.ecore.Idler Class

class efl.ecore.Idler(func, *args, **kargs)

Bases: efl.eo.Eo

Add an idler handler.

This class represents an idler on the event loop that will call func when there is nothing more to do. The function will be passed any extra parameters given to constructor.

When the idler func is called, it must return a value of either True or False (remember that Python returns None if no value is explicitly returned and None evaluates to False). If it returns True, it will be called again when system become idle, or if it returns False it will be deleted automatically making any references/handles for it invalid.

Idlers should be stopped/deleted by means of delete()or returning False from func, otherwise they’ll continue alive, even if the current python context delete it’s reference to it.

Idlers are useful for progressively prossessing data without blocking.

Parameters
  • func (callable) – Function to call when system is idle.

  • *args – All the remaining arguments will be passed back in the callback function.

  • **kwargs – All the remaining keyword arguments will be passed back in the callback function.

Expected func signature:

func(*args, **kargs): bool
delete()

Stop callback emission and free internal resources.

is_deleted()

Check if the object has been deleted thus leaving the object shallow.

Returns

True if the object has been deleted yet, False otherwise.

Return type

bool

stop()

Alias for stop().