Connector

Main app

Methods

  • __init__(self, config : typing.Optional[dict]) -> None

    Parameters

    • Name
      self
      Type
      Default
      Description

    • Name
      config
      Type
      typing.Optional[dict]
      Default
      = None
      Description

  • register(self, feature : sila.server.Feature) -> None

    Register a new feature to this driver

    Parameters

    • Name
      self
      Type
      Default
      Description

    • Name
      feature
      Type
      sila.server.Feature
      Default
      Description

  • start(self) -> None

    Start the connector and all related services.

  • close(self) -> None

    Close the connector and all related services.

  • on_shutdown(self, handler : Handler) -> None

    Add a shutdown hook to be called in the terminating phase (in response to an explicit call to `app.close()` or upon receipt of system signals such as SIGINT or SIGTERM).

    Parameters

    • Name
      self
      Type
      Default
      Description

    • Name
      handler
      Type
      Handler
      Default
      Description

      The method to be called on shutdown.

    Exceptions

    Type
    TypeError
    Description
    If the `handler` argument is not callable.
  • off_shutdown(self, handler : Handler) -> None

    Remove a previously added shutdown hook.

    Parameters

    • Name
      self
      Type
      Default
      Description

    • Name
      handler
      Type
      Handler
      Default
      Description

      The handler to be removed from the shutdown hooks.

Attributes

  • Name
    __config
    Type
    Value

    = Config.parse_obj(config or {})

    Description

  • Name
    _shutdown_handlers
    Type
    list[Handler]
    Value

    = []

    Description

  • Name
    _sila_server
    Type
    Value

    = server.Server(config=self.config.sila_server)

    Description

  • Name
    _broadcaster
    Type
    Value

    = discovery.Broadcaster(self._sila_server)

    Description

  • Name
    _cloud_server_endpoint
    Type
    Value

    = cloud_connector.CloudServerEndpoint(self._sila_server, self.config.cloud_server_endpoint)

    Description

  • Name
    config
    Type
    Config
    Value

    = None

    Description

  • Name
    sila_server
    Type
    sila.server.Server
    Value

    = None

    Description

  • Name
    logger
    Type
    logging.Logger
    Value

    = None

    Description

    class:`~logging.Logger` for the app.

  • Name
    debug
    Type
    bool
    Value

    = None

    Description

    Whether debug mode is enabled.

Copyright © 2024