Skip to content

Commit

Permalink
adapt based start
Browse files Browse the repository at this point in the history
Adapt the initialization and starting of based to the latest changes in
the based code.

Signed-off-by: hwipl <33433250+hwipl@users.noreply.github.com>
  • Loading branch information
hwipl committed Dec 20, 2019
1 parent c53689e commit f9cc3cb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions nuqql_slixmppd/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ class BackendServer:
def __init__(self) -> None:
self.connections: Dict[int, BackendClient] = {}
self.threads: Dict[int, Tuple[Thread, Event]] = {}
self.based = Based("slixmppd", VERSION)

def start(self) -> None:
"""
Start server
"""

# register callbacks
callbacks = [
Expand All @@ -59,15 +65,9 @@ def __init__(self) -> None:
(Callback.CHAT_USERS, self.enqueue),
(Callback.CHAT_INVITE, self.enqueue),
]
self.based.set_callbacks(callbacks)

# start based
self.based = Based("slixmppd", VERSION, callbacks)

def start(self) -> None:
"""
Start server
"""

self.based.start()

def enqueue(self, account_id: int, cmd: Callback, params: Tuple) -> str:
Expand Down

0 comments on commit f9cc3cb

Please sign in to comment.