This repository has been archived on 2015-04-30. You can view files and clone it, but cannot push or open issues or pull requests.
stream/python/example.py
2015-04-29 17:24:11 -04:00

27 lines
487 B
Python

from jsh import Stream
import sys
def main():
s = Stream(sys.stdout, 4)
s.start()
for i in range(7):
proc = {"pid": i + 1, "name": "init"}
s.output("things", proc)
q = s.new_stream('q')
q.output("test", 'potato')
for i in range(10):
proc = {"pid": i + 1, "name": "init"}
s.output("processes", proc)
q.output("test", 'salad')
q.output("test", 'rocks')
s.flush()
s.stop()
if __name__ == '__main__':
main()