boss.worker - heros-boss 0.6.10 documentation

Skip to content
Back to top
View this page

# boss.worker

## Classes

`Worker` | Use the communication between two processes via a pipe to implement RPC.
`WorkerRemote` | Use the communication between two processes via a pipe to implement RPC.

## Functions

`get_max_workers`(→ int) | Get the maximum number of worker processes to use.
`start_hero_in_worker`(config, realm, boss_name, boss_loop) | This launcher to start a new worker in it's own process
`launch_worker`(config, realm, boss_name, pipe) | This is the entry point in the worker.

## Module Contents

boss.worker.get_max_workers() → int

  Get the maximum number of worker processes to use.

  For Windows systems, caps the worker count at 32. For other platforms, returns the total CPU count.

  Returns:

    The maximum number of worker processes to use

boss.worker.start_hero_in_worker(config, realm, boss_name, boss_loop)

  This launcher to start a new worker in it’s own process

boss.worker.launch_worker(config, realm, boss_name, pipe)

  This is the entry point in the worker.

class boss.worker.Worker(config, realm, boss_name, pipe)

  Bases: `boss.multiprocess.MultiprocessRPC`

  Use the communication between two processes via a pipe to implement RPC.

  In BOSS this is used to communicate between the BOSS object in the main process and the BOSSRemote running in a separate process. This becomes necessary since zenoh/rust/pyO3 does not allow to run in the main process and in dynamically generated processes.

  _loop
  _obj
  run()
  stop()

class boss.worker.WorkerRemote(loop, pipe)

  Bases: `boss.multiprocess.MultiprocessRPC`

  Use the communication between two processes via a pipe to implement RPC.

  In BOSS this is used to communicate between the BOSS object in the main process and the BOSSRemote running in a separate process. This becomes necessary since zenoh/rust/pyO3 does not allow to run in the main process and in dynamically generated processes.

  stop()