/
invocation.py
42 lines (31 loc) · 1.24 KB
/
invocation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from . base import Message
class Invocation(Message):
"""Actual invocation of an endpoint sent by Dealer to a Callee.
[INVOCATION, Request|id, REGISTERED.Registration|id,
Details|dict]
[INVOCATION, Request|id, REGISTERED.Registration|id,
Details|dict, C* Arguments|list]
[INVOCATION, Request|id, REGISTERED.Registration|id,
Details|dict, CALL.Arguments|list, CALL.ArgumentsKw|dict]
"""
WAMP_CODE = 68
name = "invocation"
def __init__(
self, request_id, registration_id, details,
call_args=None, call_kwargs=None,
):
super(Invocation, self).__init__()
self.request_id = request_id
self.registration_id = registration_id
self.details = details
self.call_args = call_args or tuple()
self.call_kwargs = call_kwargs or {}
@property
def message(self):
return [
self.WAMP_CODE, self.request_id, self.registration_id,
self.details, self.call_args, self.call_kwargs,
]