iris-pex-embedded-python 3.4.4b5__tar.gz → 3.5.0__tar.gz
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.
- {iris_pex_embedded_python-3.4.4b5/src/iris_pex_embedded_python.egg-info → iris_pex_embedded_python-3.5.0}/PKG-INFO +1 -1
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/pyproject.toml +1 -1
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_business_host.py +46 -12
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_business_operation.py +1 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_dispatch.py +17 -2
- iris_pex_embedded_python-3.5.0/src/iop/_generator_request.py +30 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_message.py +17 -6
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_serialization.py +56 -28
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_utils.py +30 -4
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/BusinessProcess.cls +12 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/Common.cls +109 -1
- iris_pex_embedded_python-3.5.0/src/iop/cls/IOP/Generator/Message/Ack.cls +31 -0
- iris_pex_embedded_python-3.5.0/src/iop/cls/IOP/Generator/Message/Poll.cls +31 -0
- iris_pex_embedded_python-3.5.0/src/iop/cls/IOP/Generator/Message/Start.cls +15 -0
- iris_pex_embedded_python-3.5.0/src/iop/cls/IOP/Generator/Message/StartPickle.cls +15 -0
- iris_pex_embedded_python-3.5.0/src/iop/cls/IOP/Generator/Message/Stop.cls +32 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/PrivateSession/Duplex.cls +1 -1
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/PrivateSession/Message/Start.cls +4 -5
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/Utils.cls +88 -7
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0/src/iris_pex_embedded_python.egg-info}/PKG-INFO +1 -1
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iris_pex_embedded_python.egg-info/SOURCES.txt +6 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/LICENSE +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/README.md +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/setup.cfg +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/setup.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/BusinessOperation.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/BusinessProcess.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/BusinessService.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/Common.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/Director.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/Duplex/Operation.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/Duplex/Process.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/Duplex/Service.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/InboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/Message.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/OutboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/PickleMessage.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/PrivateSession/Duplex.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Ack.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Poll.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Start.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Stop.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/Test.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/PEX/Utils.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/cls/Grongier/Service/WSGI.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/pex/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/pex/__main__.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/pex/_business_host.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/pex/_cli.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/pex/_common.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/pex/_director.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/pex/_utils.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/grongier/pex/wsgi/handlers.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/__main__.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_async_request.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_business_process.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_business_service.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_cli.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_common.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_debugpy.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_decorators.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_director.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_inbound_adapter.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_iris.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_log_manager.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_message_validator.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_outbound_adapter.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_private_session_duplex.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_private_session_process.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/BusinessOperation.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/BusinessService.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/Director.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/Duplex/Operation.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/Duplex/Process.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/Duplex/Service.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/InboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/Message/JSONSchema.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/Message.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/OutboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/PickleMessage.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/PrivateSession/Message/Ack.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/PrivateSession/Message/Poll.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/PrivateSession/Message/Stop.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/Service/WSGI.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/Test.cls +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/wsgi/handlers.py +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iris_pex_embedded_python.egg-info/dependency_links.txt +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iris_pex_embedded_python.egg-info/entry_points.txt +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iris_pex_embedded_python.egg-info/requires.txt +0 -0
- {iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iris_pex_embedded_python.egg-info/top_level.txt +0 -0
{iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_business_host.py
RENAMED
|
@@ -4,9 +4,10 @@ from typing import Any,List, Optional, Tuple, Union
|
|
|
4
4
|
from . import _iris
|
|
5
5
|
from ._common import _Common
|
|
6
6
|
from ._message import _Message as Message
|
|
7
|
-
from ._decorators import input_serializer_param, output_deserializer
|
|
8
|
-
from ._dispatch import dispatch_serializer, dispatch_deserializer
|
|
7
|
+
from ._decorators import input_serializer_param, output_deserializer, input_deserializer, output_serializer
|
|
8
|
+
from ._dispatch import dispatch_serializer, dispatch_deserializer, dispach_message
|
|
9
9
|
from ._async_request import AsyncRequest
|
|
10
|
+
from ._generator_request import _GeneratorRequest
|
|
10
11
|
|
|
11
12
|
class _BusinessHost(_Common):
|
|
12
13
|
"""Base class for business components that defines common methods.
|
|
@@ -68,6 +69,21 @@ class _BusinessHost(_Common):
|
|
|
68
69
|
"""
|
|
69
70
|
return await AsyncRequest(target, request, timeout, description, self)
|
|
70
71
|
|
|
72
|
+
def send_generator_request(self, target: str, request: Union[Message, Any],
|
|
73
|
+
timeout: int = -1, description: Optional[str] = None) -> _GeneratorRequest:
|
|
74
|
+
"""Send message as a generator request to target component.
|
|
75
|
+
Args:
|
|
76
|
+
target: Name of target component
|
|
77
|
+
request: Message to send
|
|
78
|
+
timeout: Timeout in seconds, -1 means wait forever
|
|
79
|
+
description: Optional description for logging
|
|
80
|
+
Returns:
|
|
81
|
+
_GeneratorRequest: An instance of _GeneratorRequest to iterate over responses
|
|
82
|
+
Raises:
|
|
83
|
+
TypeError: If request is not of type Message
|
|
84
|
+
"""
|
|
85
|
+
return _GeneratorRequest(self, target, request, timeout, description)
|
|
86
|
+
|
|
71
87
|
def send_multi_request_sync(self, target_request: List[Tuple[str, Union[Message, Any]]],
|
|
72
88
|
timeout: int = -1, description: Optional[str] = None) -> List[Tuple[str, Union[Message, Any], Any, int]]:
|
|
73
89
|
"""Send multiple messages synchronously to target components.
|
|
@@ -179,7 +195,7 @@ class _BusinessHost(_Common):
|
|
|
179
195
|
"""
|
|
180
196
|
## Parse the class code to find all invocations of send_request_sync and send_request_async
|
|
181
197
|
## and return the targets
|
|
182
|
-
|
|
198
|
+
target_list = []
|
|
183
199
|
# get the source code of the class
|
|
184
200
|
source = getsource(self.__class__)
|
|
185
201
|
# find all invocations of send_request_sync and send_request_async
|
|
@@ -194,29 +210,47 @@ class _BusinessHost(_Common):
|
|
|
194
210
|
if target.find("=") != -1:
|
|
195
211
|
# it's a keyword argument, remove the keyword
|
|
196
212
|
target = target[target.find("=")+1:].strip()
|
|
197
|
-
if target not in
|
|
198
|
-
|
|
213
|
+
if target not in target_list:
|
|
214
|
+
target_list.append(target)
|
|
199
215
|
i = source.find(method, i+1)
|
|
200
216
|
|
|
201
|
-
for target in
|
|
217
|
+
for target in target_list:
|
|
202
218
|
# if target is a string, remove the quotes
|
|
203
219
|
if target[0] == "'" and target[-1] == "'":
|
|
204
|
-
|
|
220
|
+
target_list[target_list.index(target)] = target[1:-1]
|
|
205
221
|
elif target[0] == '"' and target[-1] == '"':
|
|
206
|
-
|
|
222
|
+
target_list[target_list.index(target)] = target[1:-1]
|
|
207
223
|
# if target is a variable, try to find the value of the variable
|
|
208
224
|
else:
|
|
209
225
|
self.on_init()
|
|
210
226
|
try:
|
|
211
227
|
if target.find("self.") != -1:
|
|
212
228
|
# it's a class variable
|
|
213
|
-
|
|
229
|
+
target_list[target_list.index(target)] = getattr(self, target[target.find(".")+1:])
|
|
214
230
|
elif target.find(".") != -1:
|
|
215
231
|
# it's a class variable
|
|
216
|
-
|
|
232
|
+
target_list[target_list.index(target)] = getattr(getattr(self, target[:target.find(".")]), target[target.find(".")+1:])
|
|
217
233
|
else:
|
|
218
|
-
|
|
234
|
+
target_list[target_list.index(target)] = getattr(self, target)
|
|
219
235
|
except Exception as e:
|
|
220
236
|
pass
|
|
221
237
|
|
|
222
|
-
return
|
|
238
|
+
return target_list
|
|
239
|
+
|
|
240
|
+
@input_deserializer
|
|
241
|
+
def _dispatch_generator_started(self, request: Any) -> Any:
|
|
242
|
+
"""For internal use only."""
|
|
243
|
+
self._gen = dispach_message(self, request)
|
|
244
|
+
# check if self._gen is a generator
|
|
245
|
+
if not hasattr(self._gen, '__iter__'):
|
|
246
|
+
raise TypeError("Expected a generator or iterable object, got: {}".format(type(self._gen).__name__))
|
|
247
|
+
|
|
248
|
+
return _iris.get_iris().IOP.Generator.Message.Ack._New()
|
|
249
|
+
|
|
250
|
+
@output_serializer
|
|
251
|
+
def _dispatch_generator_poll(self) -> Any:
|
|
252
|
+
"""For internal use only."""
|
|
253
|
+
try:
|
|
254
|
+
return next(self._gen)
|
|
255
|
+
except StopIteration:
|
|
256
|
+
return _iris.get_iris().IOP.Generator.Message.Stop._New()
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from inspect import signature, Parameter
|
|
2
2
|
from typing import Any, List, Tuple, Callable
|
|
3
3
|
|
|
4
|
-
from ._serialization import serialize_message, serialize_pickle_message, deserialize_message, deserialize_pickle_message
|
|
4
|
+
from ._serialization import serialize_message, serialize_pickle_message, deserialize_message, deserialize_pickle_message, serialize_message_generator, serialize_pickle_message_generator
|
|
5
5
|
from ._message_validator import is_message_instance, is_pickle_message_instance, is_iris_object_instance
|
|
6
6
|
|
|
7
|
-
def dispatch_serializer(message: Any) -> Any:
|
|
7
|
+
def dispatch_serializer(message: Any, is_generator: bool = False) -> Any:
|
|
8
8
|
"""Serializes the message based on its type.
|
|
9
9
|
|
|
10
10
|
Args:
|
|
@@ -18,8 +18,12 @@ def dispatch_serializer(message: Any) -> Any:
|
|
|
18
18
|
"""
|
|
19
19
|
if message is not None:
|
|
20
20
|
if is_message_instance(message):
|
|
21
|
+
if is_generator:
|
|
22
|
+
return serialize_message_generator(message)
|
|
21
23
|
return serialize_message(message)
|
|
22
24
|
elif is_pickle_message_instance(message):
|
|
25
|
+
if is_generator:
|
|
26
|
+
return serialize_pickle_message_generator(message)
|
|
23
27
|
return serialize_pickle_message(message)
|
|
24
28
|
elif is_iris_object_instance(message):
|
|
25
29
|
return message
|
|
@@ -27,6 +31,9 @@ def dispatch_serializer(message: Any) -> Any:
|
|
|
27
31
|
if message == "" or message is None:
|
|
28
32
|
return message
|
|
29
33
|
|
|
34
|
+
if hasattr(message, '__iter__'):
|
|
35
|
+
raise TypeError("You may have tried to invoke a generator function without using the 'send_generator_request' method. Please use that method to handle generator functions.")
|
|
36
|
+
|
|
30
37
|
raise TypeError("The message must be an instance of a class that is a subclass of Message or IRISObject %Persistent class.")
|
|
31
38
|
|
|
32
39
|
def dispatch_deserializer(serial: Any) -> Any:
|
|
@@ -111,8 +118,16 @@ def get_handler_info(host: Any, method_name: str) -> Tuple[str, str] | None:
|
|
|
111
118
|
|
|
112
119
|
param: Parameter = next(iter(params.values()))
|
|
113
120
|
annotation = param.annotation
|
|
121
|
+
|
|
122
|
+
if isinstance(annotation, str):
|
|
123
|
+
# return it as is, assuming it's a fully qualified class name
|
|
124
|
+
return annotation, method_name
|
|
125
|
+
|
|
126
|
+
if is_iris_object_instance(annotation):
|
|
127
|
+
return f"{type(annotation).__module__}.{type(annotation).__name__}", method_name
|
|
114
128
|
|
|
115
129
|
if annotation == Parameter.empty or not isinstance(annotation, type):
|
|
130
|
+
|
|
116
131
|
return None
|
|
117
132
|
|
|
118
133
|
return f"{annotation.__module__}.{annotation.__name__}", method_name
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from typing import Any, Optional, Union
|
|
2
|
+
|
|
3
|
+
from . import _iris
|
|
4
|
+
from ._dispatch import dispatch_serializer
|
|
5
|
+
|
|
6
|
+
class _GeneratorRequest:
|
|
7
|
+
"""Generator class to interetate over responses from a request.
|
|
8
|
+
This class is used to handle the responses from a request in a generator-like manner."""
|
|
9
|
+
|
|
10
|
+
def __init__(self, host: Any, target: str, request: Any,
|
|
11
|
+
timeout: int = -1, description: Optional[str] = None) -> None:
|
|
12
|
+
self.host = host
|
|
13
|
+
self.target = target
|
|
14
|
+
self.request = request
|
|
15
|
+
|
|
16
|
+
ack_response = self.host.send_request_sync(self.target, dispatch_serializer(self.request, is_generator=True),
|
|
17
|
+
timeout=timeout, description=description)
|
|
18
|
+
|
|
19
|
+
if ack_response is None or not ack_response._IsA("IOP.Generator.Message.Ack"):
|
|
20
|
+
raise RuntimeError("Failed to send request, no acknowledgment received.")
|
|
21
|
+
|
|
22
|
+
def __iter__(self):
|
|
23
|
+
return self
|
|
24
|
+
|
|
25
|
+
def __next__(self):
|
|
26
|
+
poll = _iris.get_iris().IOP.Generator.Message.Poll._New()
|
|
27
|
+
rsp = self.host.send_request_sync(self.target, poll)
|
|
28
|
+
if rsp is None or (hasattr(rsp, '_IsA') and rsp._IsA("IOP.Generator.Message.Stop")):
|
|
29
|
+
raise StopIteration("No more responses available.")
|
|
30
|
+
return rsp
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any
|
|
1
|
+
from typing import Any, Optional
|
|
2
2
|
|
|
3
3
|
from pydantic import BaseModel
|
|
4
4
|
|
|
@@ -7,9 +7,13 @@ class _Message:
|
|
|
7
7
|
This class has no properties or methods. Users subclass Message and add properties.
|
|
8
8
|
The IOP framework provides the persistence to objects derived from the Message class.
|
|
9
9
|
"""
|
|
10
|
-
|
|
10
|
+
_iris_id: Optional[str] = None
|
|
11
|
+
|
|
12
|
+
def get_iris_id(self) -> Optional[str]:
|
|
13
|
+
"""Get the IRIS ID of the message."""
|
|
14
|
+
return self._iris_id
|
|
11
15
|
|
|
12
|
-
class _PickleMessage:
|
|
16
|
+
class _PickleMessage(_Message):
|
|
13
17
|
""" The abstract class that is the superclass for persistent messages sent from one component to another.
|
|
14
18
|
This class has no properties or methods. Users subclass Message and add properties.
|
|
15
19
|
The IOP framework provides the persistence to objects derived from the Message class.
|
|
@@ -19,11 +23,18 @@ class _PickleMessage:
|
|
|
19
23
|
class _PydanticMessage(BaseModel):
|
|
20
24
|
"""Base class for Pydantic-based messages that can be serialized to IRIS."""
|
|
21
25
|
|
|
26
|
+
_iris_id: Optional[str] = None
|
|
27
|
+
|
|
22
28
|
def __init__(self, **data: Any):
|
|
23
29
|
super().__init__(**data)
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
def get_iris_id(self) -> Optional[str]:
|
|
32
|
+
"""Get the IRIS ID of the message."""
|
|
33
|
+
return self._iris_id
|
|
34
|
+
|
|
35
|
+
class _PydanticPickleMessage(_PydanticMessage):
|
|
26
36
|
"""Base class for Pydantic-based messages that can be serialized to IRIS."""
|
|
27
|
-
|
|
37
|
+
|
|
28
38
|
def __init__(self, **data: Any):
|
|
29
|
-
super().__init__(**data)
|
|
39
|
+
super().__init__(**data)
|
|
40
|
+
|
{iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/_serialization.py
RENAMED
|
@@ -27,27 +27,21 @@ class MessageSerializer:
|
|
|
27
27
|
"""Handles message serialization and deserialization."""
|
|
28
28
|
|
|
29
29
|
@staticmethod
|
|
30
|
-
def
|
|
31
|
-
"""Convert objects to JSON-safe format."""
|
|
32
|
-
if isinstance(obj, BaseModel):
|
|
33
|
-
return obj.model_dump_json()
|
|
34
|
-
elif is_dataclass(obj) and isinstance(obj, _Message):
|
|
35
|
-
return TempPydanticModel.model_validate(dataclass_to_dict(obj)).model_dump_json()
|
|
36
|
-
else:
|
|
37
|
-
raise SerializationError(f"Object {obj} must be a Pydantic model or dataclass Message")
|
|
38
|
-
|
|
39
|
-
@staticmethod
|
|
40
|
-
def serialize(message: Any, use_pickle: bool = False) -> Any:
|
|
30
|
+
def serialize(message: Any, use_pickle: bool = False, is_generator:bool = False) -> Any:
|
|
41
31
|
"""Serializes a message to IRIS format."""
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
message = remove_iris_id(message)
|
|
33
|
+
if use_pickle:
|
|
34
|
+
return MessageSerializer._serialize_pickle(message, is_generator)
|
|
35
|
+
return MessageSerializer._serialize_json(message, is_generator)
|
|
45
36
|
|
|
46
37
|
@staticmethod
|
|
47
|
-
def _serialize_json(message: Any) -> Any:
|
|
38
|
+
def _serialize_json(message: Any, is_generator: bool = False) -> Any:
|
|
48
39
|
json_string = MessageSerializer._convert_to_json_safe(message)
|
|
49
40
|
|
|
50
|
-
|
|
41
|
+
if is_generator:
|
|
42
|
+
msg = _iris.get_iris().cls('IOP.Generator.Message.Start')._New()
|
|
43
|
+
else:
|
|
44
|
+
msg = _iris.get_iris().cls('IOP.Message')._New()
|
|
51
45
|
msg.classname = f"{message.__class__.__module__}.{message.__class__.__name__}"
|
|
52
46
|
|
|
53
47
|
if hasattr(msg, 'buffer') and len(json_string) > msg.buffer:
|
|
@@ -55,12 +49,34 @@ class MessageSerializer:
|
|
|
55
49
|
else:
|
|
56
50
|
msg.json = json_string
|
|
57
51
|
return msg
|
|
52
|
+
|
|
53
|
+
@staticmethod
|
|
54
|
+
def _serialize_pickle(message: Any, is_generator: bool = False) -> Any:
|
|
55
|
+
"""Serializes a message to IRIS format using pickle."""
|
|
56
|
+
message = remove_iris_id(message)
|
|
57
|
+
pickle_string = codecs.encode(pickle.dumps(message), "base64").decode()
|
|
58
|
+
if is_generator:
|
|
59
|
+
msg = _iris.get_iris().cls('IOP.Generator.Message.StartPickle')._New()
|
|
60
|
+
else:
|
|
61
|
+
msg = _iris.get_iris().cls('IOP.PickleMessage')._New()
|
|
62
|
+
msg.classname = f"{message.__class__.__module__}.{message.__class__.__name__}"
|
|
63
|
+
msg.jstr = _Utils.string_to_stream(pickle_string)
|
|
64
|
+
return msg
|
|
58
65
|
|
|
59
66
|
@staticmethod
|
|
60
67
|
def deserialize(serial: Any, use_pickle: bool = False) -> Any:
|
|
61
68
|
if use_pickle:
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
msg=MessageSerializer._deserialize_pickle(serial)
|
|
70
|
+
else:
|
|
71
|
+
msg=MessageSerializer._deserialize_json(serial)
|
|
72
|
+
|
|
73
|
+
try:
|
|
74
|
+
iris_id = serial._Id()
|
|
75
|
+
msg._iris_id = iris_id if iris_id else None
|
|
76
|
+
except Exception as e:
|
|
77
|
+
pass
|
|
78
|
+
|
|
79
|
+
return msg
|
|
64
80
|
|
|
65
81
|
@staticmethod
|
|
66
82
|
def _deserialize_json(serial: Any) -> Any:
|
|
@@ -87,14 +103,6 @@ class MessageSerializer:
|
|
|
87
103
|
except Exception as e:
|
|
88
104
|
raise SerializationError(f"Failed to deserialize JSON: {str(e)}")
|
|
89
105
|
|
|
90
|
-
@staticmethod
|
|
91
|
-
def _serialize_pickle(message: Any) -> Any:
|
|
92
|
-
pickle_string = codecs.encode(pickle.dumps(message), "base64").decode()
|
|
93
|
-
msg = _iris.get_iris().cls('IOP.PickleMessage')._New()
|
|
94
|
-
msg.classname = f"{message.__class__.__module__}.{message.__class__.__name__}"
|
|
95
|
-
msg.jstr = _Utils.string_to_stream(pickle_string)
|
|
96
|
-
return msg
|
|
97
|
-
|
|
98
106
|
@staticmethod
|
|
99
107
|
def _deserialize_pickle(serial: Any) -> Any:
|
|
100
108
|
string = _Utils.stream_to_string(serial.jstr)
|
|
@@ -106,6 +114,24 @@ class MessageSerializer:
|
|
|
106
114
|
if j <= 0:
|
|
107
115
|
raise SerializationError(f"Classname must include a module: {classname}")
|
|
108
116
|
return classname[:j], classname[j+1:]
|
|
117
|
+
|
|
118
|
+
@staticmethod
|
|
119
|
+
def _convert_to_json_safe(obj: Any) -> Any:
|
|
120
|
+
"""Convert objects to JSON-safe format."""
|
|
121
|
+
if isinstance(obj, BaseModel):
|
|
122
|
+
return obj.model_dump_json()
|
|
123
|
+
elif is_dataclass(obj) and isinstance(obj, _Message):
|
|
124
|
+
return TempPydanticModel.model_validate(dataclass_to_dict(obj)).model_dump_json()
|
|
125
|
+
else:
|
|
126
|
+
raise SerializationError(f"Object {obj} must be a Pydantic model or dataclass Message")
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def remove_iris_id(message: Any) -> Any:
|
|
130
|
+
try:
|
|
131
|
+
del message._iris_id
|
|
132
|
+
except AttributeError:
|
|
133
|
+
pass
|
|
134
|
+
return message
|
|
109
135
|
|
|
110
136
|
def dataclass_from_dict(klass: Type | Any, dikt: Dict) -> Any:
|
|
111
137
|
"""Converts a dictionary to a dataclass instance.
|
|
@@ -165,7 +191,9 @@ def dataclass_to_dict(instance: Any) -> Dict:
|
|
|
165
191
|
return result
|
|
166
192
|
|
|
167
193
|
# Maintain backwards compatibility
|
|
168
|
-
serialize_pickle_message = lambda msg: MessageSerializer.serialize(msg, use_pickle=True)
|
|
169
|
-
|
|
194
|
+
serialize_pickle_message = lambda msg: MessageSerializer.serialize(msg, use_pickle=True, is_generator=False)
|
|
195
|
+
serialize_pickle_message_generator = lambda msg: MessageSerializer.serialize(msg, use_pickle=True, is_generator=True)
|
|
196
|
+
serialize_message = lambda msg: MessageSerializer.serialize(msg, use_pickle=False, is_generator=False)
|
|
197
|
+
serialize_message_generator = lambda msg: MessageSerializer.serialize(msg, use_pickle=False, is_generator=True)
|
|
170
198
|
deserialize_pickle_message = lambda serial: MessageSerializer.deserialize(serial, use_pickle=True)
|
|
171
199
|
deserialize_message = lambda serial: MessageSerializer.deserialize(serial, use_pickle=False)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
|
-
import ast
|
|
4
|
-
import inspect
|
|
5
3
|
import importlib
|
|
6
4
|
import importlib.util
|
|
7
5
|
import importlib.resources
|
|
8
6
|
import json
|
|
9
|
-
|
|
7
|
+
import inspect
|
|
8
|
+
import ast
|
|
9
|
+
from typing import Any, Dict, Optional, Union, Tuple
|
|
10
10
|
|
|
11
11
|
import xmltodict
|
|
12
12
|
from pydantic import TypeAdapter
|
|
@@ -80,6 +80,31 @@ class _Utils():
|
|
|
80
80
|
"""
|
|
81
81
|
_Utils.raise_on_error(_iris.get_iris().cls('IOP.Message.JSONSchema').Import(schema_str,categories,schema_name))
|
|
82
82
|
|
|
83
|
+
@staticmethod
|
|
84
|
+
def get_python_settings() -> Tuple[str,str,str]:
|
|
85
|
+
import iris_utils._cli
|
|
86
|
+
|
|
87
|
+
pythonlib = iris_utils._cli.find_libpython()
|
|
88
|
+
pythonpath = _Utils._get_python_path()
|
|
89
|
+
pythonversion = sys.version[:4]
|
|
90
|
+
|
|
91
|
+
if not pythonlib:
|
|
92
|
+
pythonlib = ""
|
|
93
|
+
|
|
94
|
+
return pythonlib, pythonpath, pythonversion
|
|
95
|
+
|
|
96
|
+
@staticmethod
|
|
97
|
+
def _get_python_path() -> str:
|
|
98
|
+
|
|
99
|
+
if "VIRTUAL_ENV" in os.environ:
|
|
100
|
+
return os.path.join(
|
|
101
|
+
os.environ["VIRTUAL_ENV"],
|
|
102
|
+
"lib",
|
|
103
|
+
f"python{sys.version[:4]}",
|
|
104
|
+
"site-packages"
|
|
105
|
+
)
|
|
106
|
+
return ""
|
|
107
|
+
|
|
83
108
|
@staticmethod
|
|
84
109
|
def register_component(module:str,classname:str,path:str,overwrite:int=1,iris_classname:str='Python'):
|
|
85
110
|
"""
|
|
@@ -99,8 +124,9 @@ class _Utils():
|
|
|
99
124
|
"""
|
|
100
125
|
path = os.path.abspath(os.path.normpath(path))
|
|
101
126
|
fullpath = _Utils.guess_path(module,path)
|
|
127
|
+
pythonlib, pythonpath, pythonversion = _Utils.get_python_settings()
|
|
102
128
|
try:
|
|
103
|
-
_iris.get_iris().cls('IOP.Utils').dispatchRegisterComponent(module,classname,path,fullpath,overwrite,iris_classname)
|
|
129
|
+
_iris.get_iris().cls('IOP.Utils').dispatchRegisterComponent(module,classname,path,fullpath,overwrite,iris_classname,pythonlib,pythonpath,pythonversion)
|
|
104
130
|
except RuntimeError as e:
|
|
105
131
|
# New message error : Make sure the iop package is installed in iris
|
|
106
132
|
raise RuntimeError("Iris class : IOP.Utils not found. Make sure the iop package is installed in iris eg: iop --init.") from e
|
|
@@ -131,6 +131,18 @@ Storage Default
|
|
|
131
131
|
<Value name="10">
|
|
132
132
|
<Value>%traceback</Value>
|
|
133
133
|
</Value>
|
|
134
|
+
<Value name="11">
|
|
135
|
+
<Value>%PythonPath</Value>
|
|
136
|
+
</Value>
|
|
137
|
+
<Value name="12">
|
|
138
|
+
<Value>%PythonRuntimeLibrary</Value>
|
|
139
|
+
</Value>
|
|
140
|
+
<Value name="13">
|
|
141
|
+
<Value>%PythonRuntimeLibraryVersion</Value>
|
|
142
|
+
</Value>
|
|
143
|
+
<Value name="14">
|
|
144
|
+
<Value>%Venv</Value>
|
|
145
|
+
</Value>
|
|
134
146
|
</Data>
|
|
135
147
|
<Data name="persistentProperties">
|
|
136
148
|
<Attribute>persistentProperties</Attribute>
|
{iris_pex_embedded_python-3.4.4b5 → iris_pex_embedded_python-3.5.0}/src/iop/cls/IOP/Common.cls
RENAMED
|
@@ -7,28 +7,52 @@ Include Ensemble
|
|
|
7
7
|
Class IOP.Common [ Abstract, ClassType = "", ProcedureBlock, System = 4 ]
|
|
8
8
|
{
|
|
9
9
|
|
|
10
|
-
/// One or more Classpaths (separated by '|' character)
|
|
10
|
+
/// One or more Classpaths (separated by '|' character)
|
|
11
11
|
Property %classpaths As %String(MAXLEN = "");
|
|
12
12
|
|
|
13
|
+
/// Classname of the Python class to use
|
|
13
14
|
Property %classname As %String(MAXLEN = "");
|
|
14
15
|
|
|
16
|
+
/// Module of the Python class to use
|
|
15
17
|
Property %module As %String(MAXLEN = "");
|
|
16
18
|
|
|
19
|
+
/// Settings for the Python class, in the form of "property=value" pairs, separated by newlines
|
|
20
|
+
/// Example: "property1=value1\nproperty2=value2"
|
|
21
|
+
/// Note: This property is used to set the properties of the Python class dynamically
|
|
17
22
|
Property %settings As %String(MAXLEN = "");
|
|
18
23
|
|
|
19
24
|
/// Instance of class
|
|
20
25
|
Property %class As %SYS.Python;
|
|
21
26
|
|
|
27
|
+
/// Enable debugging
|
|
28
|
+
/// If set to 1, the Python class will be debugged using the debugpy module
|
|
29
|
+
/// If set to 0, the Python class will not be debugged
|
|
22
30
|
Property %enable As %Boolean;
|
|
23
31
|
|
|
32
|
+
/// Timeout in seconds for the an client debugging connection
|
|
24
33
|
Property %timeout As %Numeric [ InitialExpression = 30 ];
|
|
25
34
|
|
|
35
|
+
/// Port to use for the an client debugging connection
|
|
26
36
|
Property %port As %Numeric [ InitialExpression = 0 ];
|
|
27
37
|
|
|
38
|
+
/// Path to the Python interpreter for debugpy
|
|
28
39
|
Property %PythonInterpreterPath As %String(MAXLEN = 255);
|
|
29
40
|
|
|
41
|
+
/// Enable traceback display
|
|
30
42
|
Property %traceback As %Boolean [ InitialExpression = 1 ];
|
|
31
43
|
|
|
44
|
+
/// Enable virtual environment
|
|
45
|
+
Property %Venv As %Boolean [ InitialExpression = 0 ];
|
|
46
|
+
|
|
47
|
+
/// Virtual environment site-packages path
|
|
48
|
+
Property %PythonPath As %String(MAXLEN = 255);
|
|
49
|
+
|
|
50
|
+
/// Path to the Python runtime library
|
|
51
|
+
Property %PythonRuntimeLibrary As %String(MAXLEN = 255);
|
|
52
|
+
|
|
53
|
+
/// Version of the Python runtime library
|
|
54
|
+
Property %PythonRuntimeLibraryVersion As %String;
|
|
55
|
+
|
|
32
56
|
/// Get Class
|
|
33
57
|
Method GetClass() As %SYS.Python
|
|
34
58
|
{
|
|
@@ -78,18 +102,47 @@ Method DisplayTraceback(ex) As %Status
|
|
|
78
102
|
Method OnInit() As %Status
|
|
79
103
|
{
|
|
80
104
|
set tSC = $$$OK
|
|
105
|
+
|
|
81
106
|
try {
|
|
107
|
+
LOCK +^PythonSettings:5
|
|
108
|
+
|
|
109
|
+
if ..%Venv {
|
|
110
|
+
$$$ThrowOnError(##class(IOP.Utils).SetPythonSettings(..%PythonRuntimeLibrary, ..%PythonPath, ..%PythonRuntimeLibraryVersion))
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
do ..DisplayPythonVersion()
|
|
114
|
+
|
|
82
115
|
do $system.Python.Debugging(..%traceback)
|
|
116
|
+
|
|
83
117
|
$$$ThrowOnError(..Connect())
|
|
118
|
+
LOCK -^PythonSettings
|
|
119
|
+
|
|
84
120
|
do ..%class."_debugpy"($this)
|
|
121
|
+
|
|
85
122
|
do ..%class."_dispatch_on_init"($this)
|
|
86
123
|
} catch ex {
|
|
87
124
|
|
|
88
125
|
set tSC = ..DisplayTraceback(ex)
|
|
89
126
|
}
|
|
127
|
+
LOCK -^PythonSettings
|
|
90
128
|
quit tSC
|
|
91
129
|
}
|
|
92
130
|
|
|
131
|
+
Method DisplayPythonVersion()
|
|
132
|
+
{
|
|
133
|
+
set sys = ##class(%SYS.Python).Import("sys")
|
|
134
|
+
set version = sys.version
|
|
135
|
+
set versionInfo = sys."version_info"
|
|
136
|
+
set major = versionInfo.major
|
|
137
|
+
set minor = versionInfo.minor
|
|
138
|
+
set micro = versionInfo.micro
|
|
139
|
+
set releaseLevel = versionInfo.releaselevel
|
|
140
|
+
set serial = versionInfo.serial
|
|
141
|
+
|
|
142
|
+
$$$LOGINFO("Python Version: "_ version)
|
|
143
|
+
$$$LOGINFO("Version Info: "_ major_ "."_ minor_ "."_ micro_" ("_ releaseLevel_ ", "_serial_ ")")
|
|
144
|
+
}
|
|
145
|
+
|
|
93
146
|
ClassMethod SetPythonPath(pClasspaths)
|
|
94
147
|
{
|
|
95
148
|
set sys = ##class(%SYS.Python).Import("sys")
|
|
@@ -196,6 +249,11 @@ Method SetPropertyValues()
|
|
|
196
249
|
set tSQL = tSQL _ " and name <> '%port'"
|
|
197
250
|
set tSQL = tSQL _ " and name <> '%PythonInterpreterPath'"
|
|
198
251
|
set tSQL = tSQL _ " and name <> '%traceback'"
|
|
252
|
+
set tSQL = tSQL _ " and name <> '%PythonPath'"
|
|
253
|
+
set tSQL = tSQL _ " and name <> '%PythonRuntimeLibrary'"
|
|
254
|
+
set tSQL = tSQL _ " and name <> '%PythonRuntimeLibraryVersion'"
|
|
255
|
+
set tSQL = tSQL _ " and name <> '%settings'"
|
|
256
|
+
set tSQL = tSQL _ " and name <> '%Venv'"
|
|
199
257
|
|
|
200
258
|
set tStmt = ##class(%SQL.Statement).%New()
|
|
201
259
|
|
|
@@ -423,4 +481,54 @@ Method dispatchIsRequestDone(
|
|
|
423
481
|
quit tSC
|
|
424
482
|
}
|
|
425
483
|
|
|
484
|
+
XData MessageMap
|
|
485
|
+
{
|
|
486
|
+
<MapItems>
|
|
487
|
+
<MapItem MessageType="IOP.Generator.Message.Start"><Method>OnMsgGeneratorStart</Method></MapItem>
|
|
488
|
+
<MapItem MessageType="IOP.Generator.Message.Stop"><Method>OnMsgGeneratorStop</Method></MapItem>
|
|
489
|
+
<MapItem MessageType="IOP.Generator.Message.Poll"><Method>OnMsgGeneratorPoll</Method></MapItem>
|
|
490
|
+
</MapItems>
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
Method OnMsgGeneratorStart(
|
|
494
|
+
pRequest As IOP.Generator.Message.Start,
|
|
495
|
+
Output pResponse As %Library.Persistent) As %Status
|
|
496
|
+
{
|
|
497
|
+
#dim tSC As %Status = $$$OK
|
|
498
|
+
try {
|
|
499
|
+
set pResponse = ..%class."_dispatch_generator_started"(pRequest)
|
|
500
|
+
} catch ex {
|
|
501
|
+
set tSC = ..DisplayTraceback(ex)
|
|
502
|
+
}
|
|
503
|
+
quit tSC
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
Method OnMsgGeneratorStop(
|
|
507
|
+
pRequest As IOP.Generator.Message.Stop,
|
|
508
|
+
Output pResponse As %Library.Persistent) As %Status
|
|
509
|
+
{
|
|
510
|
+
#dim tSC As %Status = $$$OK
|
|
511
|
+
|
|
512
|
+
try {
|
|
513
|
+
set pResponse = ..%class."_dispatch_generator_stopped"(pRequest)
|
|
514
|
+
} catch ex {
|
|
515
|
+
set tSC = ..DisplayTraceback(ex)
|
|
516
|
+
}
|
|
517
|
+
quit tSC
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
Method OnMsgGeneratorPoll(
|
|
521
|
+
pPollIn As IOP.Generator.Message.Poll,
|
|
522
|
+
Output pResponse As %Library.Persistent) As %Status
|
|
523
|
+
{
|
|
524
|
+
#dim tSC As %Status = $$$OK
|
|
525
|
+
set tSC = $$$OK
|
|
526
|
+
try {
|
|
527
|
+
set pResponse = ..%class."_dispatch_generator_poll"()
|
|
528
|
+
} catch ex {
|
|
529
|
+
set tSC = ..DisplayTraceback(ex)
|
|
530
|
+
}
|
|
531
|
+
quit tSC
|
|
532
|
+
}
|
|
533
|
+
|
|
426
534
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* Copyright (c) 2022 by InterSystems Corporation.
|
|
2
|
+
Cambridge, Massachusetts, U.S.A. All rights reserved.
|
|
3
|
+
Confidential property of InterSystems Corporation. */
|
|
4
|
+
|
|
5
|
+
Class IOP.Generator.Message.Ack Extends (%Persistent, Ens.Util.MessageBodyMethods) [ ClassType = persistent, Inheritance = right, ProcedureBlock, System = 4 ]
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
Parameter DOMAIN = "Generator";
|
|
9
|
+
|
|
10
|
+
/// From 'Ens.Util.MessageBodyMethods'
|
|
11
|
+
Method %ShowContents(pZenOutput As %Boolean = 0)
|
|
12
|
+
{
|
|
13
|
+
Write $$$Text("(session-ack)")
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
Storage Default
|
|
17
|
+
{
|
|
18
|
+
<Data name="AckDefaultData">
|
|
19
|
+
<Value name="1">
|
|
20
|
+
<Value>%%CLASSNAME</Value>
|
|
21
|
+
</Value>
|
|
22
|
+
</Data>
|
|
23
|
+
<DataLocation>^IOP.Generator.Message.AckD</DataLocation>
|
|
24
|
+
<DefaultData>AckDefaultData</DefaultData>
|
|
25
|
+
<IdLocation>^IOP.Generator.Message.AckD</IdLocation>
|
|
26
|
+
<IndexLocation>^IOP.Generator.Message.AckI</IndexLocation>
|
|
27
|
+
<StreamLocation>^IOP.Generator.Message.AckS</StreamLocation>
|
|
28
|
+
<Type>%Storage.Persistent</Type>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|