Thoonk is a persistent (and fast!) system for push feeds, queues, and jobs which leverages Redis. txThoonk is the Python/Twisted implementation of Thoonk and it is interoperable with other versions of Thoonk (Thoonk.js and Thoonk.py).
Status: Implemented since version 0.1
The core of Thoonk is the feed. A feed is a subject that you can publish items to (string, binary, json, xml, whatever), each with a unique id (assigned or generated). Other apps and services may subscribe to your feeds and recieve new/update/retract notices on your feeds. Each feed persists published items that can later be queried. Feeds may also be configured for various behaviors, such as max number of items, default serializer, friendly title, etc.
Feeds are useful for clustering applications, delivering data from different sources to the end user, bridged peering APIs (pubsub hubbub, XMPP Pubsub, maintaining ATOM and RSS files, etc), persisting, application state, passing messages between users, taking input from and serving multiple APIs simultaneously, and generally persisting and pushing data around.
Status: Unimplemented, planned to 0.2
Queues are stored and interacted with in similar ways to feeds, except instead of publishes being broadcast, clients may do a "blocking get" to claim an item, ensuring that they're the only one to get it. When an item is delivered, it is deleted from the queue.
Queues are useful for direct message passing.
Status: Unimplemented, planned to 0.3
Sorted feeds are unbounded, manually ordered collections of items. Sorted feeds behave similarly to plain feeds except that items may be edited in place or inserted in arbitrary order.
Status: Unimplemented, planned to 0.4
Jobs are like Queues in that one client claims an item, but that client is also required to report that the item is finished or cancel execution. Failure to to finish the job in a configured amount of time or canceling the job results in the item being reintroduced to the available list. Unlike queues, job items are not deleted until they are finished.
Jobs are useful for distributing load, ensuring a task is completed regardless of outages, and keeping long running tasks away from synchronous interfaces.
Use pypi packages:
pip install txthoonk
txThoonk requires the txredis package and (of course) twisted package:
pip install twisted pip install txredis
In order run tests you need a redis server running on localhost:6381. You can use our supplied redis.conf:
redis-server tests/redis.conf
After start redis, you can run:
trial tests/
See examples/*.py
Read more about Thoonk at http://blog.thoonk.com
Thoonk.js is the NodeJS reference implementaion of Thoonk
http://github.com/andyet/thoonk.js
Thoonk.py is the pure python reference implementaion of Thoonk