summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-09-14 23:06:29 -0400
committerKali Kaneko <kali@leap.se>2015-09-15 12:40:02 -0400
commit9d0900de85d07ec5b7926708c51136810b337158 (patch)
tree74bdeaaf7dc4deddfd2550e2c4cabafceb016a4c /src/leap
parent0748be7aa4a7031adf55cccf3d106f0ca8e64f07 (diff)
[feat] expose async events in api
to make simpler the import of the tx client - Related: #7274
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/common/events/__init__.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/leap/common/events/__init__.py b/src/leap/common/events/__init__.py
index 87ed8ae..18d0ac8 100644
--- a/src/leap/common/events/__init__.py
+++ b/src/leap/common/events/__init__.py
@@ -39,6 +39,7 @@ import logging
import argparse
from leap.common.events import client
+from leap.common.events import txclient
from leap.common.events import server
from leap.common.events.flags import set_events_enabled
@@ -80,6 +81,10 @@ def register(event, callback, uid=None, replace=False):
return client.register(event, callback, uid, replace)
+def register_async(event, callback, uid=None, replace=False):
+ return txclient.register(event, callback, uid, replace)
+
+
def unregister(event, uid=None):
"""
Unregister callbacks for an event.
@@ -95,6 +100,10 @@ def unregister(event, uid=None):
return client.unregister(event, uid)
+def unregister_async(event, uid=None):
+ return txclient.unregister(event, uid)
+
+
def emit(event, *content):
"""
Send an event.
@@ -107,6 +116,10 @@ def emit(event, *content):
return client.emit(event, *content)
+def emit_async(event, *content):
+ return txclient.emit(event, *content)
+
+
if __name__ == "__main__":
def _echo(event, *content):