Class FeatureImplementationBase

class sila2.server.FeatureImplementationBase(parent_server: SilaServer)

Base class for all SiLA feature implementations

Parameters:

parent_server – SiLA Server that serves this feature implementation

parent_server: SilaServer

SiLA Server serving this feature implementation

start() None

Called automatically when the SiLA Server is started

Raises:

RuntimeError – When called twice

Notes

When overriding this method, don’t forget to call super().start().

stop() None

Called automatically when the SiLA Server is stopped

Raises:

RuntimeError – When called while the server is not running

Notes

When overriding this method, don’t forget to call super().stop().

run_periodically(func: Callable[[], Any], delay_seconds: float = 0.1) None

Register a function to be called periodically while the SiLA Server is running

Parameters:
  • func – Function to call periodically. Will be called without arguments. Returned values are ignored.

  • delay_seconds – Time to wait between calling func()