Skip to main content

A python library providing concurrent push based lazy linked lists

Project description

==========
Succession
==========

|build-status| |coverage|

A python library providing a useful abstraction for recording state transitions, compressing them, and distributing to multiple listeners.



Usage
=====

Compression
-----------

The :class:`Succession` class provides a way to reduce long chains of updates
down to a reduced chain with the same effect.

For example, assume that you only care about the sum of the numbers pushed to a
succession, and that it's fine to replace all of the numbers from before you started
listening with the current total. You can do something like the following:

>>> succession = Succession(compress=lambda items: [sum(items)])
<succession.Succession object at 0x7f5a65a10518>
>>> from_start = succession.iter()
>>> for i in [1, 2, 3, 4, 5]:
... succession.push(i)
... succession.close()
>>> from_end = succession.iter()
>>> list(from_start)
[1, 2, 3, 4, 5])
>>> list(from_end)
[15]

Iterators forked earlier will not miss any transitions added from the time they
were created. Compression is only applied to transitions before the fork.


Installation
============
Recommended method is to use the version from `pypi`_

.. code::

pip install succession


Links
=====
- Source code: https://github.com/bwhmather/succession
- Issue tracker: https://github.com/bwhmather/succession/issues
- Continuous integration: https://travis-ci.org/bwhmather/succession
- PyPI: https://pypi.python.org/pypi/succession


License
=======
The project is licensed under the BSD license. See `LICENSE`_ for details.


.. |build-status| image:: https://travis-ci.org/bwhmather/succession.png?branch=develop
:target: https://travis-ci.org/bwhmather/succession
:alt: Build Status
.. |coverage| image:: https://coveralls.io/repos/bwhmather/succession/badge.png?branch=develop
:target: https://coveralls.io/r/bwhmather/succession?branch=develop
:alt: Coverage
.. _pypi: https://pypi.python.org/pypi/sucession
.. _LICENSE: ./LICENSE

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

succession-0.5.0.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file succession-0.5.0.tar.gz.

File metadata

  • Download URL: succession-0.5.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for succession-0.5.0.tar.gz
Algorithm Hash digest
SHA256 e18722468cf8ef1a2f3de2a47550a91b930f775d0b2734915079aa0e8c39a2d6
MD5 c80671510b1c5f190c541be607c75560
BLAKE2b-256 ea5c4d1e97e819e58ade48fcccf29b60c9c5d87fcecbdc227bf9ff39fbec67fb

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