websockets.cli ============== .. py:module:: websockets.cli Attributes ---------- .. autoapisummary:: websockets.cli.cli Functions --------- .. autoapisummary:: websockets.cli.serve websockets.cli.listen websockets.cli.status websockets.cli.broadcast Module Contents --------------- .. py:data:: cli .. py:function:: serve(group_context: onegov.core.cli.core.GroupContext, host: str | None, port: int | None, token: str | None, sentry_dsn: str | None, sentry_environment: str | None, sentry_release: str | None) -> None Starts the global websocket server. Takes the configuration from the first found app if missing. onegov-websockets serve .. py:function:: listen(group_context: onegov.core.cli.core.GroupContext, url: str | None, schema: str | None, channel: str | None, private: bool) -> collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.websockets.WebsocketsApp], None] Listens for application-bound broadcasts from the websocket server. Requires either the selection of a websockets-enabled application or passing the optional parameters url and schema. onegov-websockets --select '/onegov_org/govikon' listen .. py:function:: status(group_context: onegov.core.cli.core.GroupContext, url: str | None, token: str | None) -> collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.websockets.WebsocketsApp], None] Shows the global status of the websocket server. Requires either the selection of a websockets-enabled application or passing the optional parameters. onegov-websockets --select '/onegov_org/govikon' status .. py:function:: broadcast(group_context: onegov.core.cli.core.GroupContext, message: str, url: str | None, schema: str | None, token: str | None, channel: str | None, private: bool) -> collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.websockets.WebsocketsApp], None] Broadcast to all application-bound connected clients. Requires either the selection of a websockets-enabled application or passing the optional parameters. onegov-websockets --select '/onegov_org/govikon' broadcast '{"event":"refresh","path":"events/abcd"}'