alphatwirl / mantichora Goto Github PK
View Code? Open in Web Editor NEWA simple interface to Python multiprocessing and threading
License: BSD 3-Clause "New" or "Revised" License
A simple interface to Python multiprocessing and threading
License: BSD 3-Clause "New" or "Revised" License
Thanks for making this available, it wraps up multiprocessing and threading nicely for my use case!
I'm using this to pull data from a server making requests using the requests package. It works, but the I think the requests.get
calls I'm making are printing debug statements for each loop. I'm using atpbar
as well and this debug statements are causing the progress bars to be re-printed alternating with the requests debug statements rather than updating.
I tried following the example showing how to use logging and tried that with level=logging.DEBUG
, but so far that hasn't prevented the debug statements from being printed. Quite possibly because I've implemented it wrong.
I just tried turning off the logging by doing the following, which worked.
def _configure_logger(self):
# handler = QueueHandler(self.logging_queue)
# logger = logging.getLogger()
# logger.setLevel(logging.DEBUG)
# logger.addHandler(handler)
pass
Any suggestions on a better option? I would think the logging example would work if it was re-directing the requests debug statements to a file, so maybe I just have an issue there. Thanks!
Jupyter Lab: 1.2.6
Python: 3.8.0
Running the following demo code:
Background Jupyter service error logging (and the above cell sinked in running status, cannot be stopped):
Process Worker-2:
Process Worker-1:
Process Worker-3:
Traceback (most recent call last):
Traceback (most recent call last):
File "/.pyenv/versions/3.8.0/lib/python3.8/multiprocessing/process.py", line 313, in _bootstrap/.pyenv/versions/3.8.0/lib/python3.8/site-packages/mantichora/hubmp.py", line 235, in run
self.run()
File "
self._run_tasks()
File "/.pyenv/versions/3.8.0/lib/python3.8/multiprocessing/process.py", line 313, in _bootstrap/.pyenv/versions/3.8.0/lib/python3.8/site-packages/mantichora/hubmp.py", line 250, in _run_tasks
self.run()
File "
message = self.task_queue.get()
File "/.pyenv/versions/3.8.0/lib/python3.8/multiprocessing/queues.py", line 116, in get/.pyenv/versions/3.8.0/lib/python3.8/site-packages/mantichora/hubmp.py", line 235, in run
return _ForkingPickler.loads(res)
File "
self._run_tasks()
File "/.pyenv/versions/3.8.0/lib/python3.8/site-packages/mantichora/hubmp.py", line 250, in _run_tasks/.pyenv/versions/3.8.0AttributeError: Can't get attribute 'task_loop' on <module 'main' (built-in)>
message = self.task_queue.get()
File "
Traceback (most recent call last):
/lib/python3.8/multiprocessing/queues.py", line 116, in get
return _ForkingPickler.loads(res)
File "/.pyenv/versions/3.8.0/lib/python3.8/multiprocessing/process.py", line 313, in _bootstrap/.pyenv/versions/3.8.0/lib/python3.8/site-packages/mantichora/hubmp.py", line 235, in run
self.run()
File "
self._run_tasks()
File "/.pyenv/versions/3.8.0/lib/python3.8/site-packages/mantichora/hubmp.py", line 250, in _run_tasks/.pyenv/versions/3.8.0/lib/python3.8/multiprocessing/queues.py", line 116, in get
message = self.task_queue.get()
AttributeError: Can't get attribute 'task_loop' on <module 'main' (built-in)>
File "
return _ForkingPickler.loads(res)
AttributeError: Can't get attribute 'task_loop' on <module 'main' (built-in)>
mantichora/mantichora/hubthreading.py
Line 154 in 228ab03
This is now inconsistent with README.
First of all I would like to thank you for your work on this awesome package.
With the 0.9.8 release (and more specifically, commit 0216c89), manthicora has stopped working for me on Windows. As far as I understand, fork
is not available with multiprocessing on Windows.
Is there a way to possibly revert to previous behaviour on Windows in a future release?
mantichora/mantichora/hubthreading.py
Line 142 in 228ab03
mantichora/mantichora/hubthreading.py
Line 178 in 228ab03
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.