question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Routing ThreadPoolExecutor results to originating parent_header/cell

See original GitHub issue

Code run in a background thread does not necessarily match the output area with the originating parent_header.

screen shot 2016-09-29 at 3 44 57 pm

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:open
  • Created 7 years ago
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
glyphcommented, Sep 30, 2016

Thanks @rgbkrk !

1reaction
rgbkrkcommented, Oct 5, 2016

I hear you on background callables - we should err on the side of message passing across boundaries.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found