This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
Sprinkler
=========
A small python library that helps you write co-routines
in an event-driven way. In short it 'sprinkles' data passed
to the '.sprinkle' function to all sub-classes of 'Task' in
a round robin manner.

A simple example:

from pysprinkler import Task, Sprinkler

class RemoteDBHandler(Task):

def __init__(self):
print("Started RemoteDBHandler")

def on_data(self, data):
print("RemoteDBHandler: {}".format(data))

def on_end(self):
print("Closing RemoteDBHandler")


class LocalDBHandler(Task):

def __init__(self):
print("Started LocalDBHandler")

def on_data(self, data):
print("LocalDBHandler: {}".format(data))

def on_end(self):
print("Closing LocalDBHandler")

class STNHandler(Task):

def __init__(self):
print("Started STNHandler")

def on_data(self, data):
print("STNHandler: {}".format(data))

def on_end(self):
print("Closing STNHandler")

rdb_handler = RemoteDBHandler()
ldb_handler = LocalDBHandler()
stn_handler = STNHandler()

s = Sprinkler([rdb_handler, ldb_handler, stn_handler])
s.start()

lines = ["Line 1", "Line 2", "Line 3", "Line 4", "Line 5"]
for line in lines:
# sends 'line' to all 'Task's in a
# round robin manner
s.sprinkle(line)
s.close()

Output:

Started RemoteDBHandler
Started LocalDBHandler
Started STNHandler
RemoteDBHandler: Line 1
LocalDBHandler: Line 1
STNHandler: Line 1
RemoteDBHandler: Line 2
LocalDBHandler: Line 2
STNHandler: Line 2
RemoteDBHandler: Line 3
LocalDBHandler: Line 3
STNHandler: Line 3
RemoteDBHandler: Line 4
LocalDBHandler: Line 4
STNHandler: Line 4
RemoteDBHandler: Line 5
LocalDBHandler: Line 5
STNHandler: Line 5
Closing RemoteDBHandler
Closing LocalDBHandler
Closing STNHandler
Release History

Release History

1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pysprinkler-1.1.tar.gz (1.7 kB) Copy SHA256 Checksum SHA256 Source Jun 14, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting