proxy.core.work.pool module#

proxy.py#

⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging.

copyright
  1. 2013-present by Abhinav Singh and contributors.

license

BSD, see LICENSE for more details.

class proxy.core.work.pool.ThreadlessPool(flags: argparse.Namespace, executor_klass: Type[T], event_queue: Optional[EventQueue] = None)[source]#

Bases: object

Manages lifecycle of threadless pool and delegates work to them using a round-robin strategy.

Example usage:

with ThreadlessPool(flags=...) as pool:
    while True:
        time.sleep(1)

If necessary, start multiple threadless pool with different work classes.

_shutdown_workers() None[source]#

Pop a running threadless worker and clean it up.

_start_worker(index: int) None[source]#

Starts a threadless worker.

setup() None[source]#

Setup threadless processes.

shutdown() None[source]#

Shutdown threadless processes.