aht / stream.py Goto Github PK
View Code? Open in Web Editor NEWLazily-evaluated, parallelizable Python pipeline.
Home Page: http://www.trinhhaianh.com/stream.py
License: MIT License
Lazily-evaluated, parallelizable Python pipeline.
Home Page: http://www.trinhhaianh.com/stream.py
License: MIT License
ABOUT ===== Streams are iterables with a pipelining mechanism to enable data-flow programming and easy parallelization. See the reference documentation at http://www.trinhhaianh.com/stream.py INSTALL ======= This module requires Python 2.6. To install system-wide: $ sudo python ./setup.py install or if you just need it in a project: $ cp ./stream.py ~/your/project
If you are processing a stream that has a chance of failure, each workers in your ThreadPool/ProcessPool will eventually hit a failure case and die.
Once all of the workers have died, processing stops.
For example, your "Retrieving web pages concurrently" only works because your ThreadPool has more workers than failures (4 workers vs 2 failures). If you reduce the number of workers to 1, it only processes the first two URLs before dying.
The documentation states:
PCollectors can collect from ForkedFeeder‘s or ProcessPool‘s (via system pipes)
...
class PCollector([waittime=0.1]): Collect items from many ForkedFeeder‘s or ProcessPool‘s.
However, when you try to pipe the output of a ProcessPool into a PCollector, it fails:
AttributeError: 'ProcessPool' object has no attribute 'outpipe'
As the error suggests, ForkedFeeder has an attribute 'outpipe', but ProcessPool does not.
I'm not sure how I could be calling it incorrectly, but I'd be glad to hear I was.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.