Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Mirror
sjrpc
Commits
b2ccb368
Commit
b2ccb368
authored
Jan 27, 2011
by
Antoine Millet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added feature to embed data on asynchronous calls.
parent
4a764643
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
sjrpc/core/rpcconnection.py
sjrpc/core/rpcconnection.py
+10
-2
No files found.
sjrpc/core/rpcconnection.py
View file @
b2ccb368
...
...
@@ -266,11 +266,18 @@ class RpcConnection(object):
:param \*\*kwargs: the keyword arguments for the call
:return: the message id of the call
'''
# Extract _data from argument:
if
'_data'
in
kwargs
:
data
=
kwargs
[
'_data'
]
del
kwargs
[
'_data'
]
else
:
data
=
None
# Send the call to the peer:
msg_id
=
self
.
_send_call
(
method_name
,
*
args
,
**
kwargs
)
self
.
_calls
[
msg_id
]
=
{
'async'
:
True
}
self
.
_calls
[
msg_id
]
=
{
'async'
:
True
,
'data'
:
data
}
return
msg_id
...
...
@@ -323,6 +330,7 @@ class RpcConnection(object):
else
:
# Else, it's an asynchonous call, so, we need to notify
# manager that the response has been received:
message
[
'data'
]
=
call
[
'data'
]
self
.
_manager
.
signal_arrival
(
message
)
# Message will be deleted from the call list by the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment