Routing ThreadPoolExecutor results to originating parent_header/cell
See original GitHub issueCode run in a background thread does not necessarily match the output area with the originating parent_header
.
In the case of the jupyter notebook, this means the last cell to be run ends up with stdout or display_data from that prior cell. Is there any way for a user to scope outputs in background threads to target an original cell?
My example above is trivial, but I’ll also give context on asychronous background tasks that a user is likely to do:
- Database queries (in my case - Hive, Presto, and SparkSQL)
- External processes
- HTTP Requests
I know @glyph cares about this too. 😉
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (11 by maintainers)
Top Results From Across the Web
concurrent.futures — Launching parallel tasks — Python 3.11 ...
ThreadPoolExecutor is an Executor subclass that uses a pool of threads to execute calls asynchronously. Deadlocks can occur when the callable associated with...
Read more >How To Get Task Results From the ThreadPoolExecutor in ...
You can get results from tasks in the ThreadPoolExecutor by calling the result() function. In this tutorial, you will discover how to get ......
Read more >python - How to keep the original order of input when using ...
You can use the map method of the ThreadExecutor: from concurrent.futures import ThreadPoolExecutor, as_completed def add_one(number): ...
Read more >How To Use ThreadPoolExecutor in Python 3 - DigitalOcean
We'll define a function well suited for invocation within threads, use ThreadPoolExecutor to execute that function, and process results from ...
Read more >How to use ThreadPoolExecutor in Python3 ? - GeeksforGeeks
Threading allows parallelism of code and Python language has two ways to achieve its 1 st is via multiprocessing module and 2 nd...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @rgbkrk !
I hear you on background callables - we should err on the side of message passing across boundaries.