Wraps a scheduler, passed as constructor argument, adding exception handling for scheduled actions. The handler should return True to indicate it handled the exception successfully. Falsy return values will be taken to indicate that the exception should be escalated (raised by this scheduler).
scheduler (SchedulerBase
) – The scheduler to be wrapped.
handler (Callable
[[Exception
], bool
]) – Callable to handle exceptions raised by wrapped scheduler.
Represents a notion of time for this scheduler. Tasks being scheduled on a scheduler will adhere to the time denoted by this property.
datetime
The scheduler’s current time, as a datetime instance.
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules a periodic piece of work.
period (Union
[timedelta
, float
]) – Period in seconds or timedelta for running the
work periodically.
action (Callable
[[Optional
[TypeVar
(_TState
)]], Optional
[TypeVar
(_TState
)]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] Initial state passed to the action upon
the first iteration.
DisposableBase
The disposable object used to cancel the scheduled recurring action (best effort).
Represents an object that schedules units of work on the current thread. You should never schedule timeouts using the CurrentThreadScheduler, as that will block the thread while waiting.
Each instance manages a number of trampolines (and queues), one for each thread that calls a schedule method. These trampolines are automatically garbage-collected when threads disappear, because they’re stored in a weak key dictionary.
Obtain a singleton instance for the current thread. Please note, if you pass this instance to another thread, it will effectively behave as if it were created by that other thread (separate trampoline and queue).
The singleton CurrentThreadScheduler instance.
Creates an object that schedules units of work on a designated thread.
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules a periodic piece of work.
period (Union
[timedelta
, float
]) – Period in seconds or timedelta for running the
work periodically.
action (Callable
[[Optional
[TypeVar
(_TState
)]], Optional
[TypeVar
(_TState
)]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] Initial state passed to the action upon
the first iteration.
DisposableBase
The disposable object used to cancel the scheduled recurring action (best effort).
Event loop scheduled on the designated event loop thread. The loop is suspended/resumed using the condition which gets notified by calls to Schedule or calls to dispose.
None
Ends the thread associated with this scheduler. All remaining work in the scheduler queue is abandoned.
None
Provides a virtual time scheduler that uses datetime for absolute time and timedelta for relative time.
Creates a new historical scheduler with the specified initial clock value.
initial_clock (Optional
[datetime
]) – Initial value for the clock.
Represents an object that schedules units of work to run immediately,
on the current thread. You’re not allowed to schedule timeouts using the
ImmediateScheduler since that will block the current thread while waiting.
Attempts to do so will raise a WouldBlockException
.
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Creates an object that schedules each unit of work on a separate thread.
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules a periodic piece of work.
period (Union
[timedelta
, float
]) – Period in seconds or timedelta for running the
work periodically.
action (Callable
[[Optional
[TypeVar
(_TState
)]], Optional
[TypeVar
(_TState
)]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] Initial state passed to the action upon
the first iteration.
DisposableBase
The disposable object used to cancel the scheduled recurring action (best effort).
A scheduler that schedules work via the thread pool.
Wraps a concurrent future as a thread.
A scheduler that schedules work via a timed callback.
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Represents an object that schedules units of work on the trampoline. You should never schedule timeouts using the TrampolineScheduler, as it will block the thread while waiting.
Each instance has its own trampoline (and queue), and you can schedule work on it from different threads. Beware though, that the first thread to call a schedule method while the trampoline is idle will then remain occupied until the queue is empty.
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Test if scheduling is required.
Gets a value indicating whether the caller must call a schedule method. If the trampoline is active, then it returns False; otherwise, if the trampoline is not active, then it returns True.
bool
Method for testing the TrampolineScheduler.
Optional
[DisposableBase
]
Virtual Scheduler. This scheduler should work with either datetime/timespan or ticks as int/int
Creates a new virtual time scheduler with the specified initial clock value.
initial_clock (Union
[datetime
, float
]) – Initial value for the clock.
Represents a notion of time for this scheduler. Tasks being scheduled on a scheduler will adhere to the time denoted by this property.
datetime
The scheduler’s current time, as a datetime instance.
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Starts the virtual time scheduler.
Any
Stops the virtual time scheduler.
None
Advances the schedulers clock to the specified absolute time, running all work til that point.
time (Union
[datetime
, float
]) – Absolute time to advance the schedulers clock to.
None
Advances the schedulers clock by the specified relative time, running all work scheduled for that timespan.
time (Union
[timedelta
, float
]) – Relative time to advance the schedulers clock by.
None
Advances the schedulers clock by the specified relative time.
time (Union
[timedelta
, float
]) – Relative time to advance the schedulers clock by.
None
Adds a relative time value to an absolute time value.
absolute (Union
[datetime
, float
]) – Absolute virtual time value.
relative (Union
[timedelta
, float
]) – Relative virtual time value to add.
Union
[datetime
, float
]
The resulting absolute virtual time sum value.
A scheduler that schedules work via the asyncio mainloop. This class does not use the asyncio threadsafe methods, if you need those please use the AsyncIOThreadSafeScheduler class.
Create a new AsyncIOScheduler.
loop (AbstractEventLoop
) – Instance of asyncio event loop to use; typically, you would
get this by asyncio.get_event_loop()
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Represents a notion of time for this scheduler. Tasks being scheduled on a scheduler will adhere to the time denoted by this property.
datetime
The scheduler’s current time, as a datetime instance.
A scheduler that schedules work via the asyncio mainloop. This is a subclass of AsyncIOScheduler which uses the threadsafe asyncio methods.
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
A scheduler that schedules work via the eventlet event loop.
Create a new EventletScheduler.
eventlet (Any
) – The eventlet module to use; typically, you would get this
by import eventlet
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Represents a notion of time for this scheduler. Tasks being scheduled on a scheduler will adhere to the time denoted by this property.
datetime
The scheduler’s current time, as a datetime instance.
A scheduler that schedules work via the GEvent event loop.
Create a new GEventScheduler.
gevent (Any
) – The gevent module to use; typically ,you would get this by
import gevent
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Represents a notion of time for this scheduler. Tasks being scheduled on a scheduler will adhere to the time denoted by this property.
datetime
The scheduler’s current time, as a datetime instance.
A scheduler that schedules work via the Tornado I/O main event loop.
Note, as of Tornado 6, this is just a wrapper around the asyncio loop.
http://tornado.readthedocs.org/en/latest/ioloop.html
Create a new IOLoopScheduler.
loop (Any
) – The ioloop to use; typically, you would get this by
tornado import ioloop; ioloop.IOLoop.current()
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Represents a notion of time for this scheduler. Tasks being scheduled on a scheduler will adhere to the time denoted by this property.
datetime
The scheduler’s current time, as a datetime instance.
A scheduler that schedules work via the Twisted reactor mainloop.
Create a new TwistedScheduler.
reactor (Any
) – The reactor to use; typically, you would get this
by from twisted.internet import reactor
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Represents a notion of time for this scheduler. Tasks being scheduled on a scheduler will adhere to the time denoted by this property.
datetime
The scheduler’s current time, as a datetime instance.
A scheduler that schedules work via the GLib main loop used in GTK+ applications.
See https://wiki.gnome.org/Projects/PyGObject
Create a new GtkScheduler.
glib (Any
) – The GLib module to use; typically, you would get this by
>>> import gi
>>> gi.require_version(‘Gtk’, ‘3.0’)
>>> from gi.repository import GLib
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules a periodic piece of work to be executed in the loop.
period (Union
[timedelta
, float
]) – Period in seconds for running the work repeatedly.
action (Callable
[[Optional
[TypeVar
(_TState
)]], Optional
[TypeVar
(_TState
)]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) –
[Optional] state to be given to the action function.
The disposable object used to cancel the scheduled action (best effort).
DisposableBase
A scheduler that schedules works for PyGame.
Note that this class expects the caller to invoke run() repeatedly.
http://www.pygame.org/docs/ref/time.html http://www.pygame.org/docs/ref/event.html
Create a new PyGameScheduler.
pygame (Any
) – The PyGame module to use; typically, you would get this by
import pygame
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
:type duetime: Union
[timedelta
, float
]
:param duetime: Relative time after which to execute the action.
:type action: Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]
:param action: Action to be executed.
:type state: Optional
[TypeVar
(_TState
)]
:param state: [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
A scheduler for a PyQt5/PySide2 event loop.
Create a new QtScheduler.
qtcore (Any
) – The QtCore instance to use; typically you would get this by
either import PyQt5.QtCore or import PySide2.QtCore
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules a periodic piece of work to be executed in the loop.
period (Union
[timedelta
, float
]) – Period in seconds for running the work repeatedly.
action (Callable
[[Optional
[TypeVar
(_TState
)]], Optional
[TypeVar
(_TState
)]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) –
[Optional] state to be given to the action function.
The disposable object used to cancel the scheduled action (best effort).
DisposableBase
A scheduler that schedules work via the Tkinter main event loop.
http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/universal.html http://effbot.org/tkinterbook/widget.htm
Create a new TkinterScheduler.
root (Any
) – The Tk instance to use; typically, you would get this by
import tkinter; tkinter.Tk()
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
A scheduler for a wxPython event loop.
Create a new WxScheduler.
wx (Any
) – The wx module to use; typically, you would get this by
import wx
Cancel all scheduled actions.
Should be called when destroying wx controls to prevent accessing dead wx objects in actions that might be pending.
None
Schedules an action to be executed.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed after duetime.
duetime (Union
[timedelta
, float
]) – Relative time after which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules an action to be executed at duetime.
duetime (Union
[datetime
, float
]) – Absolute time at which to execute the action.
action (Callable
[[SchedulerBase
, Optional
[TypeVar
(_TState
)]], Optional
[DisposableBase
]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) – [Optional] state to be given to the action function.
DisposableBase
The disposable object used to cancel the scheduled action (best effort).
Schedules a periodic piece of work to be executed in the loop.
period (Union
[timedelta
, float
]) – Period in seconds for running the work repeatedly.
action (Callable
[[Optional
[TypeVar
(_TState
)]], Optional
[TypeVar
(_TState
)]]) – Action to be executed.
state (Optional
[TypeVar
(_TState
)]) –
[Optional] state to be given to the action function.
The disposable object used to cancel the scheduled action (best effort).
DisposableBase