iris-pex-embedded-python 2.3.25b1__py3-none-any.whl → 2.3.27b2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of iris-pex-embedded-python might be problematic. Click here for more details.
- grongier/cls/Grongier/PEX/BusinessProcess.cls +0 -1
- grongier/pex/_business_host.py +34 -4
- grongier/pex/_business_process.py +15 -15
- grongier/pex/_private_session_duplex.py +1 -1
- {iris_pex_embedded_python-2.3.25b1.dist-info → iris_pex_embedded_python-2.3.27b2.dist-info}/METADATA +1 -1
- {iris_pex_embedded_python-2.3.25b1.dist-info → iris_pex_embedded_python-2.3.27b2.dist-info}/RECORD +10 -10
- {iris_pex_embedded_python-2.3.25b1.dist-info → iris_pex_embedded_python-2.3.27b2.dist-info}/WHEEL +1 -1
- {iris_pex_embedded_python-2.3.25b1.dist-info → iris_pex_embedded_python-2.3.27b2.dist-info}/LICENSE +0 -0
- {iris_pex_embedded_python-2.3.25b1.dist-info → iris_pex_embedded_python-2.3.27b2.dist-info}/entry_points.txt +0 -0
- {iris_pex_embedded_python-2.3.25b1.dist-info → iris_pex_embedded_python-2.3.27b2.dist-info}/top_level.txt +0 -0
grongier/pex/_business_host.py
CHANGED
|
@@ -8,6 +8,8 @@ import json
|
|
|
8
8
|
import importlib
|
|
9
9
|
import iris
|
|
10
10
|
|
|
11
|
+
from functools import wraps
|
|
12
|
+
|
|
11
13
|
from inspect import signature, getsource
|
|
12
14
|
|
|
13
15
|
from dacite import from_dict, Config
|
|
@@ -41,6 +43,32 @@ class _BusinessHost(_Common):
|
|
|
41
43
|
param2[key] = self._dispatch_serializer(value)
|
|
42
44
|
return fonction(self,*serialized, **param2)
|
|
43
45
|
return dispatch_serializer
|
|
46
|
+
|
|
47
|
+
def input_serialzer_param(position:int,name:str):
|
|
48
|
+
"""
|
|
49
|
+
It takes a function as an argument, and returns a function that takes the same arguments as the
|
|
50
|
+
original function, but serializes the arguments before passing them to the original function
|
|
51
|
+
|
|
52
|
+
:param fonction: the function that will be decorated
|
|
53
|
+
:return: The function dispatch_serializer is being returned.
|
|
54
|
+
"""
|
|
55
|
+
def input_serialzer_param(fonction):
|
|
56
|
+
@wraps(fonction)
|
|
57
|
+
def dispatch_serializer(self,*params, **param2):
|
|
58
|
+
# Handle positional arguments
|
|
59
|
+
serialized=[]
|
|
60
|
+
for i,param in enumerate(params):
|
|
61
|
+
if i == position:
|
|
62
|
+
serialized.append(self._dispatch_serializer(param))
|
|
63
|
+
else:
|
|
64
|
+
serialized.append(param)
|
|
65
|
+
# Handle keyword arguments
|
|
66
|
+
for key, value in param2.items():
|
|
67
|
+
if key == name:
|
|
68
|
+
param2[key] = self._dispatch_serializer(value)
|
|
69
|
+
return fonction(self,*serialized, **param2)
|
|
70
|
+
return dispatch_serializer
|
|
71
|
+
return input_serialzer_param
|
|
44
72
|
|
|
45
73
|
def output_deserialzer(fonction):
|
|
46
74
|
"""
|
|
@@ -88,7 +116,7 @@ class _BusinessHost(_Common):
|
|
|
88
116
|
return self._dispatch_serializer(fonction(self,*params, **param2))
|
|
89
117
|
return dispatch_serializer
|
|
90
118
|
|
|
91
|
-
@
|
|
119
|
+
@input_serialzer_param(1,'request')
|
|
92
120
|
@output_deserialzer
|
|
93
121
|
def send_request_sync(self, target, request, timeout=-1, description=None):
|
|
94
122
|
""" Send the specified message to the target business process or business operation synchronously.
|
|
@@ -108,7 +136,7 @@ class _BusinessHost(_Common):
|
|
|
108
136
|
|
|
109
137
|
return self.iris_handle.dispatchSendRequestSync(target,request,timeout,description)
|
|
110
138
|
|
|
111
|
-
@
|
|
139
|
+
@input_serialzer_param(1,'request')
|
|
112
140
|
def send_request_async(self, target, request, description=None):
|
|
113
141
|
""" Send the specified message to the target business process or business operation asynchronously.
|
|
114
142
|
Parameters:
|
|
@@ -161,10 +189,12 @@ class _BusinessHost(_Common):
|
|
|
161
189
|
return self._serialize_pickle_message(message)
|
|
162
190
|
elif (message is not None and self._is_iris_object_instance(message)):
|
|
163
191
|
return message
|
|
192
|
+
elif (message is None or message == ""):
|
|
193
|
+
return message
|
|
164
194
|
else:
|
|
165
195
|
# todo : decorator takes care of all the parameters, so this should never happen
|
|
166
|
-
return message
|
|
167
|
-
|
|
196
|
+
# return message
|
|
197
|
+
raise TypeError("The message must be an instance of a class that is a subclass of Message or IRISObject %Persistent class.")
|
|
168
198
|
|
|
169
199
|
def _serialize_message(self,message):
|
|
170
200
|
""" Converts a python dataclass message into an iris grongier.pex.message.
|
|
@@ -38,7 +38,7 @@ class _BusinessProcess(_BusinessHost):
|
|
|
38
38
|
"""
|
|
39
39
|
return self.OnRequest(request)
|
|
40
40
|
|
|
41
|
-
def on_response(self, request, response,
|
|
41
|
+
def on_response(self, request, response, call_request, call_response, completion_key):
|
|
42
42
|
""" Handles responses sent to the business process in response to messages that it sent to the target.
|
|
43
43
|
A production calls this method whenever a response for a specific business process arrives on the appropriate queue and is assigned a job in which to execute.
|
|
44
44
|
Typically this is a response to an asynchronous request made by the business process where the responseRequired parameter has a true value.
|
|
@@ -46,14 +46,14 @@ class _BusinessProcess(_BusinessHost):
|
|
|
46
46
|
request: An instance of IRISObject or subclass of Message that contains the initial request message sent to the business process.
|
|
47
47
|
response: An instance of IRISObject or subclass of Message that contains the response message that this business process can return
|
|
48
48
|
to the production component that sent the initial message.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
call_request: An instance of IRISObject or subclass of Message that contains the request that the business process sent to its target.
|
|
50
|
+
call_response: An instance of IRISObject or subclass of Message that contains the incoming response.
|
|
51
|
+
completion_key: A string that contains the completion_key specified in the completion_key parameter of the outgoing SendAsync() method.
|
|
52
52
|
Returns:
|
|
53
53
|
An instance of IRISObject or subclass of Message that contains the response message that this business process can return
|
|
54
54
|
to the production component that sent the initial message.
|
|
55
55
|
"""
|
|
56
|
-
return self.OnResponse(request, response,
|
|
56
|
+
return self.OnResponse(request, response, call_request, call_response, completion_key)
|
|
57
57
|
|
|
58
58
|
def on_complete(self, request, response):
|
|
59
59
|
""" Called after the business process has received and handled all responses to requests it has sent to targets.
|
|
@@ -67,7 +67,7 @@ class _BusinessProcess(_BusinessHost):
|
|
|
67
67
|
"""
|
|
68
68
|
return self.OnComplete(request, response)
|
|
69
69
|
|
|
70
|
-
@_BusinessHost.
|
|
70
|
+
@_BusinessHost.input_serialzer_param(0,'response')
|
|
71
71
|
def reply(self, response):
|
|
72
72
|
""" Send the specified response to the production component that sent the initial request to the business process.
|
|
73
73
|
|
|
@@ -77,15 +77,15 @@ class _BusinessProcess(_BusinessHost):
|
|
|
77
77
|
|
|
78
78
|
return self.iris_handle.dispatchReply(response)
|
|
79
79
|
|
|
80
|
-
def set_timer(self, timeout,
|
|
80
|
+
def set_timer(self, timeout, completion_key=None):
|
|
81
81
|
""" Specifies the maximum time the business process will wait for responses.
|
|
82
82
|
|
|
83
83
|
Parameters:
|
|
84
84
|
timeout: an integer that specifies a number of seconds, or a string that specifies a time period such as"PT15s",
|
|
85
85
|
which represents 15 seconds of processor time.
|
|
86
|
-
|
|
86
|
+
completion_key: a string that will be returned with the response if the maximum time is exceeded.
|
|
87
87
|
"""
|
|
88
|
-
self.iris_handle.dispatchSetTimer(timeout,
|
|
88
|
+
self.iris_handle.dispatchSetTimer(timeout, completion_key)
|
|
89
89
|
return
|
|
90
90
|
|
|
91
91
|
def _set_iris_handles(self, handle_current, handle_partner):
|
|
@@ -151,10 +151,10 @@ class _BusinessProcess(_BusinessHost):
|
|
|
151
151
|
|
|
152
152
|
@_BusinessHost.input_deserialzer
|
|
153
153
|
@_BusinessHost.output_serialzer
|
|
154
|
-
def _dispatch_on_response(self, host_object, request, response,
|
|
154
|
+
def _dispatch_on_response(self, host_object, request, response, call_request, call_response, completion_key):
|
|
155
155
|
""" For internal use only. """
|
|
156
156
|
self._restore_persistent_properties(host_object)
|
|
157
|
-
return_object = self.on_response(request, response,
|
|
157
|
+
return_object = self.on_response(request, response, call_request, call_response, completion_key)
|
|
158
158
|
self._save_persistent_properties(host_object)
|
|
159
159
|
return return_object
|
|
160
160
|
|
|
@@ -181,7 +181,7 @@ class _BusinessProcess(_BusinessHost):
|
|
|
181
181
|
"""
|
|
182
182
|
return
|
|
183
183
|
|
|
184
|
-
def OnResponse(self, request, response,
|
|
184
|
+
def OnResponse(self, request, response, call_request, call_response, completion_key):
|
|
185
185
|
"""
|
|
186
186
|
DEPRECATED : use on_response
|
|
187
187
|
Handles responses sent to the business process in response to messages that it sent to the target.
|
|
@@ -191,9 +191,9 @@ class _BusinessProcess(_BusinessHost):
|
|
|
191
191
|
request: An instance of IRISObject or subclass of Message that contains the initial request message sent to the business process.
|
|
192
192
|
response: An instance of IRISObject or subclass of Message that contains the response message that this business process can return
|
|
193
193
|
to the production component that sent the initial message.
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
call_request: An instance of IRISObject or subclass of Message that contains the request that the business process sent to its target.
|
|
195
|
+
call_response: An instance of IRISObject or subclass of Message that contains the incoming response.
|
|
196
|
+
completion_key: A string that contains the completion_key specified in the completion_key parameter of the outgoing SendAsync() method.
|
|
197
197
|
Returns:
|
|
198
198
|
An instance of IRISObject or subclass of Message that contains the response message that this business process can return
|
|
199
199
|
to the production component that sent the initial message.
|
|
@@ -54,7 +54,7 @@ class _PrivateSessionDuplex(_BusinessHost):
|
|
|
54
54
|
"""
|
|
55
55
|
return
|
|
56
56
|
|
|
57
|
-
@_BusinessHost.
|
|
57
|
+
@_BusinessHost.input_serialzer_param(0,'document')
|
|
58
58
|
@_BusinessHost.output_deserialzer
|
|
59
59
|
def send_document_to_process(self, document):
|
|
60
60
|
""" Send the specified message to the target business process or business operation synchronously.
|
{iris_pex_embedded_python-2.3.25b1.dist-info → iris_pex_embedded_python-2.3.27b2.dist-info}/RECORD
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
grongier/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
grongier/cls/Grongier/PEX/BusinessOperation.cls,sha256=qvLahHnQPAKMrGCekQNXPJgKPvlCWH5nJa0eYvceGvQ,932
|
|
3
|
-
grongier/cls/Grongier/PEX/BusinessProcess.cls,sha256=
|
|
3
|
+
grongier/cls/Grongier/PEX/BusinessProcess.cls,sha256=RXrn9lOJmqe8dSyrX9EA1qYG23jtGXv0AdgJ36e9Lrc,2590
|
|
4
4
|
grongier/cls/Grongier/PEX/BusinessService.cls,sha256=2FXGkJ29zU3m-BcMVJTqD9skG9o7GvcHw60DAx4Fj3s,1039
|
|
5
5
|
grongier/cls/Grongier/PEX/Common.cls,sha256=YEguYAhs9_nA2A0LHZpRtQ7wUqueaRPSS2LO_fOTGVs,5754
|
|
6
6
|
grongier/cls/Grongier/PEX/Director.cls,sha256=wImRl1P37_A-Om8ahl2hfl92hxicqKnKAqzHOE4L8wg,1894
|
|
@@ -21,9 +21,9 @@ grongier/cls/Grongier/PEX/PrivateSession/Message/Stop.cls,sha256=ofVKjrN6UPFasal
|
|
|
21
21
|
grongier/cls/Grongier/Service/WSGI.cls,sha256=1PY1SxZCp7PIQrm5_td74_Uf1M_1Mn4IkDGX2WOE9sA,10445
|
|
22
22
|
grongier/pex/__init__.py,sha256=nvcmRCxLy-lpL5GzlCKrmsSK8LF8Q0aKddx6ib8U50E,1166
|
|
23
23
|
grongier/pex/__main__.py,sha256=ebEYPDOBKiXOlmdI4onpQLzfBKU4wyfijYyquA5dWV4,107
|
|
24
|
-
grongier/pex/_business_host.py,sha256=
|
|
24
|
+
grongier/pex/_business_host.py,sha256=ec0y27POk-A7J2jPiTeoujzh30caVETJEpe11R-lcTQ,22245
|
|
25
25
|
grongier/pex/_business_operation.py,sha256=W_B9Ci1fei8SGcElkAd13gV9S4BNKeQciTMVqxxJVZc,3509
|
|
26
|
-
grongier/pex/_business_process.py,sha256=
|
|
26
|
+
grongier/pex/_business_process.py,sha256=QCiaB-f5hwgh10NVkCCkX-dLttdLhRXFB_K9eXmKiBE,11886
|
|
27
27
|
grongier/pex/_business_service.py,sha256=8CgpjcdVmv5747CTa3Lw3B48RYXq2SQN9qfdxvqEI5g,3735
|
|
28
28
|
grongier/pex/_cli.py,sha256=NcMA3sXMDYA2NnGG0LB9Eww14aEmQbu0jQywWJZGD7E,6297
|
|
29
29
|
grongier/pex/_common.py,sha256=yiJ-sH4ml5u9qEnZFX_4F-Rn2X6shtMhceJA9RCMChI,15158
|
|
@@ -32,7 +32,7 @@ grongier/pex/_inbound_adapter.py,sha256=aQqRfyw69Iz6AaYzeTAbC_ERDvKadY3tSSC1LJCU
|
|
|
32
32
|
grongier/pex/_message.py,sha256=BmwBXriykU66bwAgRbdkMpjfJRVWoNRX2eDc9TXfXzA,325
|
|
33
33
|
grongier/pex/_outbound_adapter.py,sha256=HOxTSGwgQVDXzYpSMArLEmipPNYLxOCFaiN51MelFNA,735
|
|
34
34
|
grongier/pex/_pickle_message.py,sha256=noKfc2VkXufV3fqjKvNHN_oANQ1YN9ffCaSV0XSTAIE,331
|
|
35
|
-
grongier/pex/_private_session_duplex.py,sha256=
|
|
35
|
+
grongier/pex/_private_session_duplex.py,sha256=UVpGhk1lID8Dyear7Q35nXc3VL0d2J5-i63-f_QxvBc,5053
|
|
36
36
|
grongier/pex/_private_session_process.py,sha256=_2r_csWcVRLmIUt4O0Y1Hg1FcX6A08lt9DvALQhwu8s,1722
|
|
37
37
|
grongier/pex/_utils.py,sha256=GjHT5WolQAoeYkhHP3a0uDBlRzPIkyGG_bi-TwrMdjI,15877
|
|
38
38
|
grongier/pex/wsgi/handlers.py,sha256=NrFLo_YbAh-x_PlWhAiWkQnUUN2Ss9HoEm63dDWCBpQ,2947
|
|
@@ -105,9 +105,9 @@ iris/iris_ipm.py,sha256=Q0jcNItjywlqOPZr0hgdTFSeLPNEmB-tcICOI_cXnaY,790
|
|
|
105
105
|
iris/iris_ipm.pyi,sha256=j7CNUZcjeDu5sgeWUZJO_Qi4vQmHh6aD-jPWv8OdoUs,374
|
|
106
106
|
irisnative/_IRISNative.py,sha256=HQ4nBhc8t8_5OtxdMG-kx1aa-T1znf2I8obZOPLOPzg,665
|
|
107
107
|
irisnative/__init__.py,sha256=6YmvBLQSURsCPKaNg7LK-xpo4ipDjrlhKuwdfdNb3Kg,341
|
|
108
|
-
iris_pex_embedded_python-2.3.
|
|
109
|
-
iris_pex_embedded_python-2.3.
|
|
110
|
-
iris_pex_embedded_python-2.3.
|
|
111
|
-
iris_pex_embedded_python-2.3.
|
|
112
|
-
iris_pex_embedded_python-2.3.
|
|
113
|
-
iris_pex_embedded_python-2.3.
|
|
108
|
+
iris_pex_embedded_python-2.3.27b2.dist-info/LICENSE,sha256=rZSiBFId_sfbJ6RL0GjjPX-InNLkNS9ou7eQsikciI8,1089
|
|
109
|
+
iris_pex_embedded_python-2.3.27b2.dist-info/METADATA,sha256=3kgWUDC6ZjhsbvxOh9Dw1lyaykxxPaq7stXt4A3DmdM,49682
|
|
110
|
+
iris_pex_embedded_python-2.3.27b2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
111
|
+
iris_pex_embedded_python-2.3.27b2.dist-info/entry_points.txt,sha256=atkAtHoIuwXcZ0jl5gwof0l__ru_lt8WhVYk6HxYf70,47
|
|
112
|
+
iris_pex_embedded_python-2.3.27b2.dist-info/top_level.txt,sha256=Tl4ZHgeNefaZW2Oug30vSldhD-tWzixsIfzASBrZ9ps,43
|
|
113
|
+
iris_pex_embedded_python-2.3.27b2.dist-info/RECORD,,
|
{iris_pex_embedded_python-2.3.25b1.dist-info → iris_pex_embedded_python-2.3.27b2.dist-info}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|