@@ -33,6 +33,7 @@ def _user_from_conn(conn):
33
33
"""
34
34
make a model.User from a connection using its curve pubkey as the session id.
35
35
"""
36
+ # TODO: blinding?
36
37
return model .User (session_id = '05' + conn .pubkey .hex ())
37
38
38
39
@@ -99,7 +100,7 @@ def _collect_bytes(iterable: Iterable[bytes]):
99
100
100
101
101
102
@api (name = 'sub' , minargs = 1 )
102
- def handle_subscribe (* events , conn = None ):
103
+ def subscribe (* events , conn = None ):
103
104
""" subscribe connection to many events """
104
105
sub = set ()
105
106
for ev in events :
@@ -115,7 +116,7 @@ def handle_subscribe(*events, conn=None):
115
116
116
117
117
118
@api (name = 'unsub' , minargs = 1 )
118
- def handle_unsubscribe (* events , conn = None ):
119
+ def unsubscribe (* events , conn = None ):
119
120
""" unsub connection to many events """
120
121
unsub = set ()
121
122
for ev in events :
@@ -132,16 +133,15 @@ def handle_unsubscribe(*events, conn=None):
132
133
133
134
134
135
@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 """
137
138
ctype = None
138
139
# guess content type
139
140
if body :
140
141
if body [0 ] in (b'{' , b'[' ):
141
142
ctype = 'application/json'
142
143
else :
143
144
ctype = 'application/octet-stream'
144
-
145
145
resp = make_subrequest (
146
146
method .decode ('ascii' ), path .decode ('ascii' ), content_type = ctype , body = body
147
147
)
0 commit comments