Skip to content

Commit 1dfdec1

Browse files
author
Jeff
committed
cleanup
1 parent 7907951 commit 1dfdec1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sogs/events.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def _user_from_conn(conn):
3333
"""
3434
make a model.User from a connection using its curve pubkey as the session id.
3535
"""
36+
# TODO: blinding?
3637
return model.User(session_id='05' + conn.pubkey.hex())
3738

3839

@@ -99,7 +100,7 @@ def _collect_bytes(iterable: Iterable[bytes]):
99100

100101

101102
@api(name='sub', minargs=1)
102-
def handle_subscribe(*events, conn=None):
103+
def subscribe(*events, conn=None):
103104
""" subscribe connection to many events """
104105
sub = set()
105106
for ev in events:
@@ -115,7 +116,7 @@ def handle_subscribe(*events, conn=None):
115116

116117

117118
@api(name='unsub', minargs=1)
118-
def handle_unsubscribe(*events, conn=None):
119+
def unsubscribe(*events, conn=None):
119120
""" unsub connection to many events """
120121
unsub = set()
121122
for ev in events:
@@ -132,16 +133,15 @@ def handle_unsubscribe(*events, conn=None):
132133

133134

134135
@api(name="request", minargs=2)
135-
def handle_rpc_call(method, path, body=None, *, conn=None):
136-
""" make a sub request via zmq """
136+
def request(method, path, body=None, *, conn=None):
137+
""" make an rpc request via zmq """
137138
ctype = None
138139
# guess content type
139140
if body:
140141
if body[0] in (b'{', b'['):
141142
ctype = 'application/json'
142143
else:
143144
ctype = 'application/octet-stream'
144-
145145
resp = make_subrequest(
146146
method.decode('ascii'), path.decode('ascii'), content_type=ctype, body=body
147147
)

0 commit comments

Comments
 (0)