Poll#

class ignis.utils.Poll(timeout: int, callback: Callable, *args)#

Calls a callback every n milliseconds specified by the timeout.

You can pass arguments to the constructor, and they will be passed to the callback.

Example usage:

from ignis.utils import Utils

# print "Hello" every second
Utils.Poll(timeout=1_000, callback=lambda self: print("Hello"))
changed()#
  • Signal

Emitted at each iteration.

property timeout: int#
  • required, read-write

The timeout interval in milliseconds.

property callback: Callable#
  • required, read-write

The function to call when the timeout is reached. The self will passed as an argument.

property output: Any#
  • not argument, read-only

The output of the callback.

Hint

You can use bind() on output.

cancel() None#

Cancel polling.

Return type:

None