Skip to main content

some Queue subclasses and ducktypes

Project description

Release 20190812: _QueueIterator: do MultiOpenMixin.init so that str is functional.

Queue-like items: iterable queues and channels.

Class Channel

A zero-storage data passage. Unlike a Queue(1), put() blocks waiting for the matching get().

Function IterablePriorityQueue(capacity=0, name=None, *args, **kw)

Factory to create an iterable PriorityQueue.

Function IterableQueue(capacity=0, name=None, *args, **kw)

Factory to create an iterable Queue.

Class NullQueue

MRO: cs.resources.MultiOpenMixin
A queue-like object that discards its inputs. Calls to .get() raise Queue_Empty.

Method NullQueue.__init__(self, blocking=False, name=None)

Initialise the NullQueue.

Parameters:

  • blocking: if true, calls to .get() block until .shutdown(). Default: False.
  • name: a name for this NullQueue.

Class PushQueue

MRO: cs.resources.MultiOpenMixin
A puttable object which looks like an iterable Queue.

Calling .put(item) calls func_push supplied at initialisation to trigger a function on data arrival, whose processing is mediated queued via a Later for delivery to the output queue.

Method PushQueue.__init__(self, name, functor, outQ)

Initialise the PushQueue with the Later L, the callable functor and the output queue outQ.

Parameters:

  • functor is a one-to-many function which accepts a single item of input and returns an iterable of outputs; it may be a generator. These outputs are passed to outQ.put individually as received.
  • outQ is a MultiOpenMixin which accepts via its .put() method.

Class TimerQueue

Class to run a lot of "in the future" jobs without using a bazillion Timer threads.

Release Log

Release 20190812: _QueueIterator: do MultiOpenMixin.init so that str is functional.

Release 20181022: Bugfix Channel, drasticly simplify PushQueue, other minor changes.

Release 20160828: Use "install_requires" instead of "requires" in DISTINFO. TimerQueue.add: support optional *a and **kw arguments for func. Many bugfixes and internal changes.

Release 20150115: More PyPI metadata fixups.

Release 20150111: Initial PyPI release.

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

cs.queues-20190812.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file cs.queues-20190812.tar.gz.

File metadata

  • Download URL: cs.queues-20190812.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.4

File hashes

Hashes for cs.queues-20190812.tar.gz
Algorithm Hash digest
SHA256 5b24356a8e19d19151a1944351f7b145e9cd21c37fe0416ed6ec32e39674a336
MD5 528bd9d3ab170bd49f0b83191d08954e
BLAKE2b-256 e61482369f3cc7ab975f1369e546a41e0b590a920c57c9ba468e34c2ef7153f5

See more details on using hashes here.

Supported by

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