cleichner/pipeline — comment on commit 833faf2873c3103fa7fd4190f064ce873cde8048
File: read.py line 16
By cwvh:

I think this is cleaner if ``pipeline.__init__`` takes positional arguments and client code utilizes that:

@pipeline(out=args.out_port)

Then,

class pipeline(object):
def __init__(self, in=None, out=None, host='localhost'):
self.in = in or []
# if they gave us a single port instead of a list or ports, make it iterable
if not isinstance(self.in, collections.Iterable):
self.in = [self.in]
...

...

@pipeline(in=range(5000, 5010+1), out=8888)
def worker(): pass

@pipeline(in=1234)
def sink(): pass