Skip to content

Simplifies the creation of asynchronous, multiprocess, and multithreaded code

License

Notifications You must be signed in to change notification settings

HunterAP23/amped

Repository files navigation

AMPED

Asynchronous Multi-Pool Execution Director

Simplifies the creation & management of asynchronous thread & process pools.

Summary

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.

Examples

Creating a Process Pool for CPU-bound tasks

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")

Using a Process Pool

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

Using the Map function

ints = [1, 2, 3, 4]
print("ints is {}".format(ints))
  print(handler.map("process-group-one", "first", doubler, ints))

Creating a Thread Pools for I/O-bound Tasks

About

Simplifies the creation of asynchronous, multiprocess, and multithreaded code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages