#!/usr/bin/env python
from setuptools import setup
setup(
  name = 'cs.queues',
  author = 'Cameron Simpson',
  author_email = 'cs@cskk.id.au',
  version = '20201025',
  url = 'https://bitbucket.org/cameron_simpson/css/commits/all',
  description =
    'some Queue subclasses and ducktypes',
  long_description =
    ('Queue-like items: iterable queues and channels.\n'    
 '\n'    
 '*Latest release 20201025*:\n'    
 'Drop obsolete call to MultiOpenMixin.__init__.\n'    
 '\n'    
 '## Class `Channel`\n'    
 '\n'    
 'A zero-storage data passage.\n'    
 'Unlike a Queue(1), put() blocks waiting for the matching get().\n'    
 '\n'    
 '### Method `Channel.__call__(self, *a)`\n'    
 '\n'    
 'Call the Channel.\n'    
 'With no arguments, do a .get().\n'    
 'With an argument, do a .put().\n'    
 '\n'    
 '### Method `Channel.close(self)`\n'    
 '\n'    
 'Close the Channel, preventing further puts.\n'    
 '\n'    
 '### Method `Channel.get(self, *a, **kw)`\n'    
 '\n'    
 'Wrapper function to check that this instance is not closed.\n'    
 '\n'    
 '### Method `Channel.put(self, *a, **kw)`\n'    
 '\n'    
 'Wrapper function to check that this instance is not closed.\n'    
 '\n'    
 '## Function `IterablePriorityQueue(capacity=0, name=None)`\n'    
 '\n'    
 'Factory to create an iterable PriorityQueue.\n'    
 '\n'    
 '## Function `IterableQueue(capacity=0, name=None)`\n'    
 '\n'    
 'Factory to create an iterable Queue.\n'    
 '\n'    
 '## `NullQ = <NullQueue:NullQ blocking=False>`\n'    
 '\n'    
 'A queue-like object that discards its inputs.\n'    
 'Calls to .get() raise Queue_Empty.\n'    
 '\n'    
 '## Class `NullQueue(cs.resources.MultiOpenMixin)`\n'    
 '\n'    
 'A queue-like object that discards its inputs.\n'    
 'Calls to .get() raise Queue_Empty.\n'    
 '\n'    
 '### Method `NullQueue.__init__(self, blocking=False, name=None)`\n'    
 '\n'    
 'Initialise the NullQueue.\n'    
 '\n'    
 'Parameters:\n'    
 '* `blocking`: if true, calls to .get() block until .shutdown().\n'    
 '  Default: False.\n'    
 '* `name`: a name for this NullQueue.\n'    
 '\n'    
 '### Method `NullQueue.get(self)`\n'    
 '\n'    
 'Get the next value. Always raises Queue_Empty.\n'    
 'If .blocking, delay until .shutdown().\n'    
 '\n'    
 '### Method `NullQueue.put(self, item)`\n'    
 '\n'    
 'Put a value onto the Queue; it is discarded.\n'    
 '\n'    
 '### Method `NullQueue.shutdown(self)`\n'    
 '\n'    
 'Shut down the queue.\n'    
 '\n'    
 '### Method `NullQueue.startup(self)`\n'    
 '\n'    
 'Start the queue.\n'    
 '\n'    
 '## Class `PushQueue(cs.resources.MultiOpenMixin)`\n'    
 '\n'    
 'A puttable object which looks like an iterable Queue.\n'    
 '\n'    
 'Calling .put(item) calls `func_push` supplied at initialisation\n'    
 'to trigger a function on data arrival, whose processing is mediated\n'    
 'queued via a Later for delivery to the output queue.\n'    
 '\n'    
 '### Method `PushQueue.__init__(self, name, functor, outQ)`\n'    
 '\n'    
 'Initialise the PushQueue with the Later `L`, the callable `functor`\n'    
 'and the output queue `outQ`.\n'    
 '\n'    
 'Parameters:\n'    
 '* `functor` is a one-to-many function which accepts a single\n'    
 '  item of input and returns an iterable of outputs; it may be a\n'    
 '  generator. These outputs are passed to outQ.put individually as\n'    
 '  received.\n'    
 '* `outQ` is a MultiOpenMixin which accepts via its .put() method.\n'    
 '\n'    
 '### Method `PushQueue.put(self, *a, **kw)`\n'    
 '\n'    
 'Wrapper function to check that this instance is not closed.\n'    
 '\n'    
 '### Method `PushQueue.shutdown(self)`\n'    
 '\n'    
 'shutdown() is called by MultiOpenMixin._close() to close\n'    
 'the outQ for real.\n'    
 '\n'    
 '### Method `PushQueue.startup(self)`\n'    
 '\n'    
 'Start up.\n'    
 '\n'    
 '## Class `TimerQueue`\n'    
 '\n'    
 'Class to run a lot of "in the future" jobs without using a bazillion\n'    
 'Timer threads.\n'    
 '\n'    
 '### Method `TimerQueue.add(self, when, func)`\n'    
 '\n'    
 "Queue a new job to be called at 'when'.\n"    
 "'func' is the job function, typically made with functools.partial.\n"    
 '\n'    
 '### Method `TimerQueue.close(self, cancel=False)`\n'    
 '\n'    
 'Close the TimerQueue. This forbids further job submissions.\n'    
 'If `cancel` is supplied and true, cancel all pending jobs.\n'    
 'Note: it is still necessary to call TimerQueue.join() to\n'    
 'wait for all pending jobs.\n'    
 '\n'    
 '### Method `TimerQueue.join(self)`\n'    
 '\n'    
 'Wait for the main loop thread to finish.\n'    
 '\n'    
 '# Release Log\n'    
 '\n'    
 '\n'    
 '\n'    
 '*Release 20201025*:\n'    
 'Drop obsolete call to MultiOpenMixin.__init__.\n'    
 '\n'    
 '*Release 20200718*:\n'    
 '_QueueIterator: set finalise_later via new MultiOpenMixin property, required '    
 'by recent MultiOpenMixin change.\n'    
 '\n'    
 '*Release 20200521*:\n'    
 'IterableQueue,IterablePriorityQueue: simplify wrappers, bypasses weird bug '    
 'from overengineering these.\n'    
 '\n'    
 '*Release 20191007*:\n'    
 '* PushQueue: improve __str__.\n'    
 '* Clean lint, drop cs.obj dependency.\n'    
 '\n'    
 '*Release 20190812*:\n'    
 '_QueueIterator: do MultiOpenMixin.__init__ so that __str__ is functional.\n'    
 '\n'    
 '*Release 20181022*:\n'    
 'Bugfix Channel, drasticly simplify PushQueue, other minor changes.\n'    
 '\n'    
 '*Release 20160828*:\n'    
 '* Use "install_requires" instead of "requires" in DISTINFO.\n'    
 '* TimerQueue.add: support optional *a and **kw arguments for func.\n'    
 '* Many bugfixes and internal changes.\n'    
 '\n'    
 '*Release 20150115*:\n'    
 'More PyPI metadata fixups.\n'    
 '\n'    
 '*Release 20150111*:\n'    
 'Initial PyPI release.'),
  classifiers = ['Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Topic :: Software Development :: Libraries :: Python Modules', 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)'],
  install_requires = ['cs.logutils', 'cs.pfx', 'cs.py3', 'cs.resources', 'cs.seq'],
  keywords = ['python2', 'python3'],
  license = 'GNU General Public License v3 or later (GPLv3+)',
  long_description_content_type = 'text/markdown',
  package_dir = {'': 'lib/python'},
  py_modules = ['cs.queues'],
)
