Asynchronous Multi-Pool Execution Director
Simplifies the creation & management of asynchronous thread & process pools.
AMPED is a cross-platform process and thread pool management library. It makes the steps required for creating thread and process pools much simpler, adds new features such as pool management & pool-nesting, provides thread-safe data transfer methods, and allows for granular control over CPU core assignment of individual pools.
from amped import amped
def doubler(n):
return n * 2
handler = amped()
handler.create(library="multiprocess", pool_type="process", group="process-group-one", name="first")
ints = [1, 2, 3, 4]
print("ints is {}".format(ints))
for i in ints:
print(handler.map("process-group-one", "first", doubler, i))
The output will then be:
[1, 2, 3, 4]
2
4
6
8
ints = [1, 2, 3, 4]
print("ints is {}".format(ints))
print(handler.map("process-group-one", "first", doubler, ints))