boss.multiprocess - heros-boss 0.6.7 documentation

Skip to content
Back to top
View this page

# boss.multiprocess

## Attributes

`POLLING_INTERVAL` |

## Classes

`Message` |
`MethodCallMessage` |
`AttributeGetMessage` |
`AttributeSetMessage` |
`ResultMessage` |
`ErrorMessage` |
`MultiprocessRPC` | Use the communication between two processes via a pipe to implement RPC.

## Module Contents

boss.multiprocess.POLLING_INTERVAL = 0.01

class boss.multiprocess.Message(*args, **kwargs)
  fields = ['id', 'type']
  _decode(raw_message)
  encode()
  static parse(raw_message)

class boss.multiprocess.MethodCallMessage(*args, **kwargs)

  Bases: `Message`

  TYPE = 'c'
  fields = ['method', 'args', 'kwargs']

class boss.multiprocess.AttributeGetMessage(*args, **kwargs)

  Bases: `Message`

  TYPE = 'g'
  fields = ['name']

class boss.multiprocess.AttributeSetMessage(*args, **kwargs)

  Bases: `Message`

  TYPE = 's'
  fields = ['name', 'value']

class boss.multiprocess.ResultMessage(*args, **kwargs)

  Bases: `Message`

  TYPE = 'r'
  fields = ['payload']

class boss.multiprocess.ErrorMessage(*args, **kwargs)

  Bases: `Message`

  TYPE = 'e'
  fields = ['error']

class boss.multiprocess.MultiprocessRPC(loop, pipe)

  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
  _pipe
  _pending_results
  _shutdown = False
  _communicatation_task
  async _communicate()
  _send_message(message)
  _handle_message(message)
  _rpc(method_name, *args, _cb=None, **kwargs)
  _get_attribute(name: str, local_name: str | None = None)
  _set_attribute(name: str, value: object)
  _rpc_stop()