Questions tagged [concurrent.futures]

concurrent.futures is a Python module which provides a high-level interface for asynchronously executing callables.

The concurrent.futures module aims to provide a simple interface for parallelizing operations in multi-threaded and multi-process Python applications. The module was added to the Python standard library in version 3.2, but a backport is available for Python 2.5+.

929 questions
0
votes
2 answers

Streaming sockets from ProcessPoolExecutor

I'm trying to create a Python application in which one process (process 'A') receives a request and puts it into a ProcessPool (from concurrent.futures). In handling this request, a message may need to passed to a second process (process 'B'). I'm…
0
votes
1 answer

Cached Thread Pool growing infinitely

I am trying to implement a cached thread pool in Java to read data coming in off of a bus. Everything works great... so long as I have data coming in on that bus. If I leave the data cable disconnected, the program starts generating endless threads…
lrich
  • 80
  • 9
0
votes
1 answer

Scala and time-limited processing

I'm taking Michael Genesereth's General Game Playing (GGP) Coursera course. In GGP a player is allowed a fixed amount of time to make a move. I'm writing my players in Scala. (The underlying GGP codebase is Java.) Does Scala provide any support (or…
RussAbbott
  • 2,660
  • 4
  • 24
  • 37
0
votes
1 answer

Scala Future does not return anything when allocating too much memory

Using Scala-IDE 3.0.3 (based on Scala 2.10.4), the following code completes correctly by displaying the first 10 values of the computed List from a future as well as the Future completedmessage: import scala.concurrent._ import…
pmudry
  • 66
  • 6
0
votes
1 answer

Python, can you pass a module level function to ThreadPoolExecutor from within a class

I'm trying to perform multithreading in python and am still trying to get my head around the picklability requirement and how much I can keep my code OOP. Can you run ThreadPoolExecutor from within a class passing it a function defined at the…
Luke
  • 6,699
  • 13
  • 50
  • 88
-1
votes
0 answers

BrokenProcessPool error seems incompatible with other debugging statements

Trying to work through some training videos for asynchronous processing. Using a local Jupyter Notebook with the necessary modules installed. Here's the code from concurrent.futures import ProcessPoolExecutor from concurrent.futures import…
THill3
  • 87
  • 6
-1
votes
1 answer

How to use ThreadPoolExecutor with an Excel file as input and scrape date from a website

I'm trying to input zip codes taken from a predefined excel file into a website to fetch populated results and write them back to the same file in a new column. To be specific, each zip code should produce a household number, which is what I want to…
-1
votes
1 answer

How concurrent.futures.ThreadPoolExecutor() would work if one thread has exit

I'm trying to understand how concurrent.futures.ThreadPoolExecutor() would work. I have piece of code blow code. If it has exit in one of the thread, it's exiting near futures for loop and not moving further step. import concurrent.futures import…
Rj_N
  • 192
  • 1
  • 10
-1
votes
1 answer

Python, use a dict over a list please

I have this code and it works. I wrote it to use a list a while back and I am revisiting it and wondering if I can add url and red to a dict rather than a list. def starts_with_hash(child: str) -> bool: if not child.startswith('#'): …
uncrayon
  • 395
  • 2
  • 11
-1
votes
1 answer

Why does a result() from concurrent.futures.as_completed() occasionally return None?

I've been writing a fairly complex series of modules to help test our poorly documented networking gear, this one focused on trying the various passwords used across the company. I've been using the concurrent.futures module to speed things along by…
-1
votes
1 answer

how to write python concurrent future and retry correctly? Tableau API

I am a newbie to concurrent. I am trying to refresh 3 workbooks in Tableau: workbook_dict = {"workbook1":"workbook_id1","workbook2":"workbook_id2","workbook3":"workbook_id3"} @retry(tries=3, delay=5, backoff=0.2) def…
Sailormoon
  • 259
  • 1
  • 5
  • 23
-1
votes
1 answer

Concurrent is not working properly with beautifulsoup, not fetching all the links

In this code I want to extract content from a newspaper link using beautifulsoup. But it is not working properly, each link in the list "filtered_Final_LIST" has links which has multiple articles. The function 'ext_url' is not returning all the…
graj499
  • 87
  • 2
  • 12
-1
votes
1 answer

Failed to speed up the execution process of a script using concurrent.futures

I'm trying to implement concurrent.futures or something similar within the following script to make the execution faster. However, When I compare the two scripts, I see no change in speed. What possible change should I bring about to achieve the…
-1
votes
1 answer

How to kill an asyncio coroutine (not First_completed case)

There is an example: main coroutine creates coroutines that take a long time to complete, what means FIRST_COMPLETED case is unreachable. Problem: considering that await asyncio.wait(tasks) line blocks everything under itself, how to get access to…
-1
votes
1 answer

concurrent.futures raises TypeError?

In case someone else see's this same problem: ## The params should have been sent as a tuple data = [] for file in files: data.append((file, loc, symbol, under_df)) with concurrent.futures.ProcessPoolExecutor() as executor: r =…
Sid
  • 3,749
  • 7
  • 29
  • 62
1 2 3
61
62