Skip to main content

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:

  1. it doesn't have the burden of being thread-safe, which may slightly improve its performance on some platforms in single-threaded contexts
  2. it is optimized for non-blocking, rather than event-driven, usage; i.e. no delayfunc, but a driver interface where it can schedule timers with a reactor or event loop
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fritter-0.0.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

fritter-0.0.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file fritter-0.0.1.tar.gz.

File metadata

  • Download URL: fritter-0.0.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for fritter-0.0.1.tar.gz
Algorithm Hash digest
SHA256 26fcbaba5bcdea812e73a2aaffc5d210d9429984649ec3fdca2b9cb6e3f88048
MD5 30e9e0ea649ad501c76cac1f8cedbbb3
BLAKE2b-256 e71eb0aaff36d080a19930d8669cfe4e31cdbff819eeb27d3d0dd5320b98cf32

See more details on using hashes here.

File details

Details for the file fritter-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: fritter-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for fritter-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11c398b45531a9b49c0017dff9e0b9a0f69ddfef955f9120aa4fcb70d1913a02
MD5 60a9da320e08d791f7e1bede9062992a
BLAKE2b-256 3a6850aca9fd675b28f561eba2dfb8a941c2fa08353ac6e58d3274d87044e5b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page