Frame rate independent timer trees emulating real-time.
Project description
FRITTer
Frame Rate Independent Timer Tree Emulating Real-time
Sometimes you want to do something that tracks with real time but may not be called quite as often as it wants to be, because other tasks are bogging down the system or the process. Perhaps you want to play an audio sample as part of a stream, move an object in a simulation, or advance to the appropriate image for the current frame of an animation.
The 'fritter' package provides a few tools to make that easier, particularly the 'repeating' module. Inspired by Twisted's "LoopingCall.withCount" which does something similar, it is a much simpler and more decoupled implementation.
The 'scheduler' core is quite a lot like the built-in 'sched' module, with a few key differences:
- it doesn't have the burden of being thread-safe, which may slightly improve its performance on some platforms in single-threaded contexts
- it is optimized for non-blocking, rather than event-driven, usage; i.e. no
delayfunc
, but a time-driver interface where it can schedule timers with a reactor or event loop - it has an abstract interface for different priority queue implementations;
experience with Twisted has taught me that different workloads (more or
fewer events, more events added sooner or more events added later) often
have contradictory performance requirements, although
heapq
is a pretty sensible default most of the time.
(The 'tree' part is forthcoming in a later version, but the idea there is that this will be designed to be used with hierarchical simulations with sub-simulations that can be either paused or destroyed, and when that occurs they should take all of their processes and events with them.)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fritter-0.0.2.tar.gz
.
File metadata
- Download URL: fritter-0.0.2.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb838124f15c3f670499e646532b3ab9ae9bec22fac16a75c992aadaa96a71a0 |
|
MD5 | 4a76b047cd50240bc9230f69a4d0789f |
|
BLAKE2b-256 | 5f13d1f0b44ac5b46dbd02dfed084e05a6b0eac1d406a349760a5c007bb94b7a |
File details
Details for the file fritter-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: fritter-0.0.2-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e765cd1cd33f2bcbc9a8fd909f4ddf5b68633f1f8cc9cbbceb28b98f76b8b181 |
|
MD5 | 736e52cecf2754a67630684ab37ab898 |
|
BLAKE2b-256 | ed51070b3b7e33d4727a910de63c173a4b4d26fd29843f0e468b24a2be2b3890 |