boss.factory - heros-boss 0.6.10 documentation

Skip to content
Back to top
View this page

# boss.factory

## Classes

`BOSSObject` |
`Factory` |
`HEROFactory` |
`DatasourceHEROFactory` |
`PolledDatasourceHEROFactory` |

## Functions

`wrap_hero_class`(→ type) | Wrap the source class to establish HEROS compatibility.

## Module Contents

class boss.factory.BOSSObject
  _stop(boss: heros.RemoteHERO)

boss.factory.wrap_hero_class(source_class: type, name: str, arg_dict: dict, wrap_target: str | None = None) → type

  Wrap the source class to establish HEROS compatibility.

  BOSS supports different external libraries which require extra treatment to expose them correctly to the HERO network. This function returns a HEROS compatible representation of the source class.

  Parameters:

    - source_class – The class to be wrapped

    - name – Name of the HERO to be created from the `source_class`

    - arg_dict – Arguments to be passed to `source_class.__init__`

    - wrap_target – By default (`None` or `"auto"`), the function tries to automatically find from which library the source class is and wrap it accordingly. By specifying `wrap_target` the wrapper function can be controlled or wrapping can be turned off by passing `no_wrap`.

class boss.factory.Factory
  _mixin_class: type
  classmethod _build(classname: str, name: str, arg_dict: dict | None = None, extra_decorators: list[tuple[str, str]] | None = None, wrap_target: str | None = None, realm: str = 'heros', session_manager=None, tags: list | None = None)
  classmethod _get_init_replacement(source_class: type, name: str, realm: str, session_manager, tags: list | None) → Callable
    Abstractmethod:

  static _decorate_methods(source_class: Any, extra_decorators: list[tuple[str, str]]) → Any

    Wrap methods on the class before instantiation.

class boss.factory.HEROFactory

  Bases: `Factory`

  _mixin_class
  classmethod build(classname: str, name: str, arg_dict: dict | None = None, extra_decorators: list[tuple[str, str]] | None = None, wrap_target: str | None = None, realm='heros', session_manager=None, tags: list | None = None)
  classmethod _get_init_replacement(source_class: type, name: str, realm: str, session_manager, tags: list | None) → Callable

class boss.factory.DatasourceHEROFactory

  Bases: `HEROFactory`

  _mixin_class
  _observables: dict
  classmethod build(classname: str, name: str, arg_dict: dict | None = None, extra_decorators: list[tuple[str, str]] | None = None, wrap_target: str | None = None, observables: dict | None = None, realm='heros', session_manager=None, tags: list | None = None)
  classmethod _get_init_replacement(source_class: type, name: str, realm: str, session_manager, tags: list | None) → Callable

class boss.factory.PolledDatasourceHEROFactory

  Bases: `Factory`

  _mixin_class
  _observables: dict
  _interval: float
  classmethod build(classname: str, name: str, arg_dict: dict | None = None, extra_decorators: list[tuple[str, str]] | None = None, wrap_target: str | None = None, loop: asyncio.AbstractEventLoop = asyncio.new_event_loop(), interval: float = 5, observables: dict | None = None, realm='heros', session_manager=None, tags: list | None = None)
  classmethod _get_init_replacement(source_class: type, name: str, realm: str, session_manager, tags: list | None) → Callable