adhocracy_core.websockets.client module¶
Our own Websocket client that notifies the server of changes.
-
class
Client(ws_url)[source]¶ Bases:
objectWebsocket Client.
Create instance with running thread that talks to the server.
Parameters: ws_url – the URL of the websocket server to connect to; if None, no connection will be set up (useful for testing) -
changelog_metadata_messages_to_send= None¶ Set with
adhocracy_core.resources.subscriber.ChangelogMetadatathat will be send to the websocket server withClient.send_messages().
-
send_messages(changelog_metadata=[])[source]¶ Send all changelog messages to the websocket server.
Parameters: changelog_metadata – list of :class:’ChangelogMetadata’, metadata.resource == None is ignored. All websocket exceptions are catched, hoping the problems will be solved when you run this method again.
-
-
get_ws_client(registry) → adhocracy_core.websockets.client.Client[source]¶ Return websocket client object or None.