zeroc-ice 3.7.10.1__cp312-cp312-win_amd64.whl → 3.8.0__cp312-cp312-win_amd64.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.
- Glacier2/CannotCreateSessionException.py +40 -0
- Glacier2/IdentitySet.py +293 -0
- Glacier2/IdentitySet_forward.py +10 -0
- Glacier2/PermissionDeniedException.py +40 -0
- Glacier2/PermissionsVerifier.py +189 -0
- Glacier2/PermissionsVerifier_forward.py +10 -0
- Glacier2/Router.py +661 -0
- Glacier2/Router_forward.py +10 -0
- Glacier2/SSLInfo.py +62 -0
- Glacier2/SSLPermissionsVerifier.py +186 -0
- Glacier2/SSLPermissionsVerifier_forward.py +10 -0
- Glacier2/SSLSessionManager.py +192 -0
- Glacier2/SSLSessionManager_forward.py +10 -0
- Glacier2/Session.py +161 -0
- Glacier2/SessionControl.py +407 -0
- Glacier2/SessionControl_forward.py +10 -0
- Glacier2/SessionManager.py +189 -0
- Glacier2/SessionManager_forward.py +10 -0
- Glacier2/SessionNotExistException.py +39 -0
- Glacier2/Session_forward.py +10 -0
- Glacier2/StringSet.py +289 -0
- Glacier2/StringSet_forward.py +10 -0
- Glacier2/__init__.py +79 -226
- Glacier2/py.typed +0 -0
- Ice/AdapterAlreadyActiveException.py +35 -0
- Ice/AdapterNotFoundException.py +35 -0
- Ice/BTEndpointType.py +11 -0
- Ice/BTSEndpointType.py +11 -0
- Ice/Blobject.py +42 -0
- Ice/BoolSeq.py +10 -0
- Ice/Builtin.py +11 -0
- Ice/ByteSeq.py +10 -0
- Ice/Communicator.py +621 -0
- Ice/CompressBatch.py +25 -0
- Ice/Context.py +10 -0
- Ice/Current.py +48 -0
- Ice/Dispatch.py +122 -0
- Ice/DoubleSeq.py +10 -0
- Ice/EncodingVersion.py +41 -0
- Ice/EndpointSelectionType.py +22 -0
- Ice/EventLoopAdapter.py +52 -0
- Ice/Exception.py +29 -0
- Ice/FloatSeq.py +10 -0
- Ice/FormatType.py +15 -0
- Ice/Future.py +375 -0
- Ice/IcePyTypes.py +47 -0
- Ice/Identity.py +40 -0
- Ice/IdentitySeq.py +12 -0
- Ice/ImplicitContext.py +126 -0
- Ice/InitializationData.py +64 -0
- Ice/IntSeq.py +10 -0
- Ice/InvalidReplicaGroupIdException.py +34 -0
- Ice/InvocationFuture.py +158 -0
- Ice/LocalException.py +12 -0
- Ice/LocalExceptions.py +546 -0
- Ice/Locator.py +332 -0
- Ice/LocatorFinder.py +163 -0
- Ice/LocatorFinder_forward.py +10 -0
- Ice/LocatorRegistry.py +387 -0
- Ice/LocatorRegistry_forward.py +10 -0
- Ice/Locator_forward.py +10 -0
- Ice/LogMessage.py +51 -0
- Ice/LogMessageSeq.py +12 -0
- Ice/LogMessageType.py +50 -0
- Ice/LogMessageTypeSeq.py +12 -0
- Ice/Logger.py +100 -0
- Ice/LoggerAdmin.py +380 -0
- Ice/LoggerAdmin_forward.py +10 -0
- Ice/LongSeq.py +10 -0
- Ice/Object.py +145 -0
- Ice/ObjectAdapter.py +588 -0
- Ice/ObjectNotFoundException.py +35 -0
- Ice/ObjectProxySeq.py +12 -0
- Ice/ObjectPrx.py +940 -0
- Ice/ObjectPrx_forward.py +7 -0
- Ice/ObjectSeq.py +12 -0
- Ice/OperationMode.py +47 -0
- Ice/Process.py +217 -0
- Ice/ProcessLogger.py +25 -0
- Ice/Process_forward.py +10 -0
- Ice/Properties.py +387 -0
- Ice/PropertiesAdmin.py +302 -0
- Ice/PropertiesAdmin_forward.py +10 -0
- Ice/PropertyDict.py +10 -0
- Ice/ProtocolVersion.py +39 -0
- Ice/Proxy.py +63 -0
- Ice/RemoteLogger.py +238 -0
- Ice/RemoteLoggerAlreadyAttachedException.py +34 -0
- Ice/RemoteLogger_forward.py +10 -0
- Ice/ReplyStatus.py +84 -0
- Ice/Router.py +322 -0
- Ice/RouterFinder.py +163 -0
- Ice/RouterFinder_forward.py +10 -0
- Ice/Router_forward.py +10 -0
- Ice/SSLEndpointType.py +11 -0
- Ice/ServantLocator.py +93 -0
- Ice/ServerNotFoundException.py +34 -0
- Ice/ShortSeq.py +10 -0
- Ice/SliceChecksumDict.py +10 -0
- Ice/SliceInfo.py +22 -0
- Ice/SlicedData.py +14 -0
- Ice/StringSeq.py +10 -0
- Ice/TCPEndpointType.py +11 -0
- Ice/ToStringMode.py +34 -0
- Ice/UDPEndpointType.py +11 -0
- Ice/URIEndpointType.py +11 -0
- Ice/UnknownSlicedValue.py +31 -0
- Ice/UserException.py +18 -0
- Ice/Util.py +170 -0
- Ice/Value.py +59 -0
- Ice/Value_forward.py +7 -0
- Ice/WSEndpointType.py +11 -0
- Ice/WSSEndpointType.py +11 -0
- Ice/_ArrayUtil.py +51 -0
- Ice/_LoggerI.py +32 -0
- Ice/__init__.py +367 -2008
- Ice/asyncio/EventLoopAdapter.py +31 -0
- Ice/asyncio/__init__.py +5 -0
- Ice/iAPEndpointType.py +11 -0
- Ice/iAPSEndpointType.py +11 -0
- Ice/py.typed +0 -0
- IceBox/AlreadyStartedException.py +34 -0
- IceBox/AlreadyStoppedException.py +34 -0
- IceBox/NoSuchServiceException.py +34 -0
- IceBox/ServiceManager.py +447 -0
- IceBox/ServiceManager_forward.py +10 -0
- IceBox/ServiceObserver.py +229 -0
- IceBox/ServiceObserver_forward.py +10 -0
- IceBox/__init__.py +33 -10
- IceBox/py.typed +0 -0
- IceGrid/AccessDeniedException.py +40 -0
- IceGrid/AdapterDescriptor.py +77 -0
- IceGrid/AdapterDescriptorSeq.py +12 -0
- IceGrid/AdapterDynamicInfo.py +46 -0
- IceGrid/AdapterDynamicInfoSeq.py +12 -0
- IceGrid/AdapterInfo.py +50 -0
- IceGrid/AdapterInfoSeq.py +12 -0
- IceGrid/AdapterNotExistException.py +40 -0
- IceGrid/AdapterObserver.py +338 -0
- IceGrid/AdapterObserver_forward.py +10 -0
- IceGrid/AdaptiveLoadBalancingPolicy.py +48 -0
- IceGrid/AdaptiveLoadBalancingPolicy_forward.py +10 -0
- IceGrid/Admin.py +3662 -0
- IceGrid/AdminSession.py +1406 -0
- IceGrid/AdminSession_forward.py +10 -0
- IceGrid/Admin_forward.py +10 -0
- IceGrid/AllocationException.py +40 -0
- IceGrid/AllocationTimeoutException.py +35 -0
- IceGrid/ApplicationDescriptor.py +89 -0
- IceGrid/ApplicationDescriptorSeq.py +12 -0
- IceGrid/ApplicationInfo.py +63 -0
- IceGrid/ApplicationInfoSeq.py +12 -0
- IceGrid/ApplicationNotExistException.py +40 -0
- IceGrid/ApplicationObserver.py +374 -0
- IceGrid/ApplicationObserver_forward.py +10 -0
- IceGrid/ApplicationUpdateDescriptor.py +118 -0
- IceGrid/ApplicationUpdateInfo.py +51 -0
- IceGrid/BadSignalException.py +40 -0
- IceGrid/BoxedDistributionDescriptor.py +49 -0
- IceGrid/BoxedDistributionDescriptor_forward.py +10 -0
- IceGrid/BoxedString.py +45 -0
- IceGrid/BoxedString_forward.py +10 -0
- IceGrid/CommunicatorDescriptor.py +79 -0
- IceGrid/CommunicatorDescriptor_forward.py +10 -0
- IceGrid/DbEnvDescriptor.py +55 -0
- IceGrid/DbEnvDescriptorSeq.py +12 -0
- IceGrid/DeploymentException.py +40 -0
- IceGrid/DistributionDescriptor.py +42 -0
- IceGrid/FileIterator.py +246 -0
- IceGrid/FileIterator_forward.py +10 -0
- IceGrid/FileNotAvailableException.py +49 -0
- IceGrid/FileParser.py +182 -0
- IceGrid/FileParser_forward.py +10 -0
- IceGrid/IceBoxDescriptor.py +55 -0
- IceGrid/IceBoxDescriptor_forward.py +10 -0
- IceGrid/LoadBalancingPolicy.py +45 -0
- IceGrid/LoadBalancingPolicy_forward.py +10 -0
- IceGrid/LoadInfo.py +43 -0
- IceGrid/LoadSample.py +45 -0
- IceGrid/Locator.py +232 -0
- IceGrid/Locator_forward.py +10 -0
- IceGrid/NodeDescriptor.py +71 -0
- IceGrid/NodeDescriptorDict.py +12 -0
- IceGrid/NodeDynamicInfo.py +57 -0
- IceGrid/NodeDynamicInfoSeq.py +12 -0
- IceGrid/NodeInfo.py +64 -0
- IceGrid/NodeNotExistException.py +40 -0
- IceGrid/NodeObserver.py +424 -0
- IceGrid/NodeObserver_forward.py +10 -0
- IceGrid/NodeUnreachableException.py +46 -0
- IceGrid/NodeUpdateDescriptor.py +92 -0
- IceGrid/NodeUpdateDescriptorSeq.py +12 -0
- IceGrid/ObjectDescriptor.py +48 -0
- IceGrid/ObjectDescriptorSeq.py +12 -0
- IceGrid/ObjectExistsException.py +44 -0
- IceGrid/ObjectInfo.py +46 -0
- IceGrid/ObjectInfoSeq.py +12 -0
- IceGrid/ObjectNotRegisteredException.py +44 -0
- IceGrid/ObjectObserver.py +347 -0
- IceGrid/ObjectObserver_forward.py +10 -0
- IceGrid/ObserverAlreadyRegisteredException.py +49 -0
- IceGrid/OrderedLoadBalancingPolicy.py +41 -0
- IceGrid/OrderedLoadBalancingPolicy_forward.py +10 -0
- IceGrid/ParseException.py +40 -0
- IceGrid/PermissionDeniedException.py +40 -0
- IceGrid/PropertyDescriptor.py +39 -0
- IceGrid/PropertyDescriptorSeq.py +12 -0
- IceGrid/PropertySetDescriptor.py +49 -0
- IceGrid/PropertySetDescriptorDict.py +12 -0
- IceGrid/Query.py +451 -0
- IceGrid/Query_forward.py +10 -0
- IceGrid/RandomLoadBalancingPolicy.py +41 -0
- IceGrid/RandomLoadBalancingPolicy_forward.py +10 -0
- IceGrid/Registry.py +477 -0
- IceGrid/RegistryInfo.py +39 -0
- IceGrid/RegistryInfoSeq.py +12 -0
- IceGrid/RegistryNotExistException.py +40 -0
- IceGrid/RegistryObserver.py +282 -0
- IceGrid/RegistryObserver_forward.py +10 -0
- IceGrid/RegistryUnreachableException.py +46 -0
- IceGrid/Registry_forward.py +10 -0
- IceGrid/ReplicaGroupDescriptor.py +66 -0
- IceGrid/ReplicaGroupDescriptorSeq.py +12 -0
- IceGrid/RoundRobinLoadBalancingPolicy.py +41 -0
- IceGrid/RoundRobinLoadBalancingPolicy_forward.py +10 -0
- IceGrid/ServerDescriptor.py +107 -0
- IceGrid/ServerDescriptorSeq.py +12 -0
- IceGrid/ServerDescriptor_forward.py +10 -0
- IceGrid/ServerDynamicInfo.py +50 -0
- IceGrid/ServerDynamicInfoSeq.py +12 -0
- IceGrid/ServerInfo.py +62 -0
- IceGrid/ServerInstanceDescriptor.py +58 -0
- IceGrid/ServerInstanceDescriptorSeq.py +12 -0
- IceGrid/ServerNotExistException.py +40 -0
- IceGrid/ServerStartException.py +46 -0
- IceGrid/ServerState.py +66 -0
- IceGrid/ServerStopException.py +46 -0
- IceGrid/ServiceDescriptor.py +53 -0
- IceGrid/ServiceDescriptorSeq.py +12 -0
- IceGrid/ServiceDescriptor_forward.py +10 -0
- IceGrid/ServiceInstanceDescriptor.py +60 -0
- IceGrid/ServiceInstanceDescriptorSeq.py +12 -0
- IceGrid/Session.py +498 -0
- IceGrid/Session_forward.py +10 -0
- IceGrid/StringObjectProxyDict.py +12 -0
- IceGrid/StringStringDict.py +10 -0
- IceGrid/TemplateDescriptor.py +55 -0
- IceGrid/TemplateDescriptorDict.py +12 -0
- IceGrid/UserAccountMapper.py +178 -0
- IceGrid/UserAccountMapper_forward.py +10 -0
- IceGrid/UserAccountNotFoundException.py +34 -0
- IceGrid/__init__.py +375 -17
- IceGrid/py.typed +0 -0
- IceMX/ChildInvocationMetrics.py +56 -0
- IceMX/ChildInvocationMetrics_forward.py +10 -0
- IceMX/CollocatedMetrics.py +42 -0
- IceMX/CollocatedMetrics_forward.py +10 -0
- IceMX/ConnectionMetrics.py +53 -0
- IceMX/ConnectionMetrics_forward.py +10 -0
- IceMX/DispatchMetrics.py +57 -0
- IceMX/DispatchMetrics_forward.py +10 -0
- IceMX/InvocationMetrics.py +66 -0
- IceMX/InvocationMetrics_forward.py +10 -0
- IceMX/Metrics.py +66 -0
- IceMX/MetricsAdmin.py +586 -0
- IceMX/MetricsAdmin_forward.py +10 -0
- IceMX/MetricsFailures.py +42 -0
- IceMX/MetricsFailuresSeq.py +12 -0
- IceMX/MetricsMap.py +12 -0
- IceMX/MetricsView.py +12 -0
- IceMX/Metrics_forward.py +10 -0
- IceMX/RemoteMetrics.py +42 -0
- IceMX/RemoteMetrics_forward.py +10 -0
- IceMX/SessionMetrics.py +73 -0
- IceMX/SessionMetrics_forward.py +10 -0
- IceMX/StringIntDict.py +10 -0
- IceMX/SubscriberMetrics.py +57 -0
- IceMX/SubscriberMetrics_forward.py +10 -0
- IceMX/ThreadMetrics.py +59 -0
- IceMX/ThreadMetrics_forward.py +10 -0
- IceMX/TopicMetrics.py +53 -0
- IceMX/TopicMetrics_forward.py +10 -0
- IceMX/UnknownMetricsView.py +34 -0
- IceMX/__init__.py +75 -12
- IceMX/py.typed +0 -0
- IcePy-stubs/__init__.pyi +740 -0
- IcePy.cp312-win_amd64.pdb +0 -0
- IcePy.cp312-win_amd64.pyd +0 -0
- IceStorm/AlreadySubscribed.py +34 -0
- IceStorm/BadQoS.py +40 -0
- IceStorm/Finder.py +163 -0
- IceStorm/Finder_forward.py +10 -0
- IceStorm/LinkExists.py +40 -0
- IceStorm/LinkInfo.py +50 -0
- IceStorm/LinkInfoSeq.py +12 -0
- IceStorm/NoSuchLink.py +40 -0
- IceStorm/NoSuchTopic.py +40 -0
- IceStorm/QoS.py +10 -0
- IceStorm/Topic.py +825 -0
- IceStorm/TopicDict.py +12 -0
- IceStorm/TopicExists.py +40 -0
- IceStorm/TopicManager.py +394 -0
- IceStorm/TopicManager_forward.py +10 -0
- IceStorm/Topic_forward.py +10 -0
- IceStorm/__init__.py +61 -10
- IceStorm/py.typed +0 -0
- slice/DataStorm/SampleEvent.ice +29 -0
- slice/Glacier2/Metrics.ice +47 -88
- slice/Glacier2/PermissionsVerifier.ice +55 -111
- slice/Glacier2/Router.ice +93 -186
- slice/Glacier2/SSLInfo.ice +42 -59
- slice/Glacier2/Session.ice +133 -274
- slice/Ice/BuiltinSequences.ice +54 -59
- slice/Ice/Context.ice +24 -0
- slice/Ice/EndpointTypes.ice +50 -48
- slice/Ice/Identity.ice +36 -75
- slice/Ice/Locator.ice +74 -239
- slice/Ice/LocatorRegistry.ice +77 -0
- slice/Ice/Metrics.ice +201 -436
- slice/Ice/OperationMode.ice +38 -0
- slice/Ice/Process.ice +28 -64
- slice/Ice/PropertiesAdmin.ice +37 -87
- slice/Ice/PropertyDict.ice +23 -0
- slice/Ice/RemoteLogger.ice +126 -226
- slice/Ice/ReplyStatus.ice +65 -0
- slice/Ice/Router.ice +54 -103
- slice/Ice/SliceChecksumDict.ice +18 -36
- slice/Ice/Version.ice +43 -51
- slice/IceBox/ServiceManager.ice +79 -0
- slice/IceGrid/Admin.ice +981 -1957
- slice/IceGrid/Descriptor.ice +519 -1094
- slice/IceGrid/Exception.ice +98 -396
- slice/IceGrid/FileParser.ice +36 -72
- slice/IceGrid/Registry.ice +130 -269
- slice/IceGrid/Session.ice +64 -128
- slice/IceGrid/UserAccountMapper.ice +34 -69
- slice/IceStorm/IceStorm.ice +186 -414
- slice/IceStorm/Metrics.ice +41 -83
- slice2py.py +20 -21
- zeroc_ice-3.8.0.dist-info/METADATA +106 -0
- zeroc_ice-3.8.0.dist-info/RECORD +344 -0
- {zeroc_ice-3.7.10.1.dist-info → zeroc_ice-3.8.0.dist-info}/WHEEL +1 -1
- {zeroc_ice-3.7.10.1.dist-info → zeroc_ice-3.8.0.dist-info}/top_level.txt +1 -1
- Glacier2/Metrics_ice.py +0 -82
- Glacier2/PermissionsVerifierF_ice.py +0 -32
- Glacier2/PermissionsVerifier_ice.py +0 -284
- Glacier2/RouterF_ice.py +0 -28
- Glacier2/Router_ice.py +0 -618
- Glacier2/SSLInfo_ice.py +0 -179
- Glacier2/Session_ice.py +0 -1103
- Ice/BuiltinSequences_ice.py +0 -65
- Ice/CommunicatorF_ice.py +0 -27
- Ice/Communicator_ice.py +0 -469
- Ice/ConnectionF_ice.py +0 -33
- Ice/Connection_ice.py +0 -680
- Ice/Current_ice.py +0 -175
- Ice/EndpointF_ice.py +0 -45
- Ice/EndpointTypes_ice.py +0 -54
- Ice/Endpoint_ice.py +0 -304
- Ice/FacetMap_ice.py +0 -27
- Ice/Identity_ice.py +0 -133
- Ice/ImplicitContextF_ice.py +0 -27
- Ice/ImplicitContext_ice.py +0 -119
- Ice/InstrumentationF_ice.py +0 -38
- Ice/Instrumentation_ice.py +0 -566
- Ice/LocalException_ice.py +0 -1715
- Ice/LocatorF_ice.py +0 -32
- Ice/Locator_ice.py +0 -728
- Ice/LoggerF_ice.py +0 -27
- Ice/Logger_ice.py +0 -96
- Ice/Metrics_ice.py +0 -864
- Ice/ObjectAdapterF_ice.py +0 -27
- Ice/ObjectAdapter_ice.py +0 -461
- Ice/ObjectFactory_ice.py +0 -68
- Ice/PluginF_ice.py +0 -30
- Ice/Plugin_ice.py +0 -136
- Ice/ProcessF_ice.py +0 -28
- Ice/Process_ice.py +0 -175
- Ice/PropertiesAdmin_ice.py +0 -247
- Ice/PropertiesF_ice.py +0 -31
- Ice/Properties_ice.py +0 -199
- Ice/Py3/IceFuture.py +0 -52
- Ice/Py3/__init__.py +0 -3
- Ice/RemoteLogger_ice.py +0 -617
- Ice/RouterF_ice.py +0 -28
- Ice/Router_ice.py +0 -350
- Ice/ServantLocatorF_ice.py +0 -27
- Ice/ServantLocator_ice.py +0 -110
- Ice/SliceChecksumDict_ice.py +0 -29
- Ice/ValueFactory_ice.py +0 -125
- Ice/Version_ice.py +0 -217
- IceBox/IceBox_ice.py +0 -644
- IceGrid/Admin_ice.py +0 -6662
- IceGrid/Descriptor_ice.py +0 -1795
- IceGrid/Exception_ice.py +0 -592
- IceGrid/FileParser_ice.py +0 -171
- IceGrid/PluginFacade_ice.py +0 -288
- IceGrid/Registry_ice.py +0 -985
- IceGrid/Session_ice.py +0 -406
- IceGrid/UserAccountMapper_ice.py +0 -166
- IcePatch2/FileInfo_ice.py +0 -287
- IcePatch2/FileServer_ice.py +0 -555
- IcePatch2/__init__.py +0 -11
- IceStorm/IceStorm_ice.py +0 -1265
- IceStorm/Metrics_ice.py +0 -106
- slice/Glacier2/PermissionsVerifierF.ice +0 -30
- slice/Glacier2/RouterF.ice +0 -29
- slice/Ice/Communicator.ice +0 -676
- slice/Ice/CommunicatorF.ice +0 -31
- slice/Ice/Connection.ice +0 -516
- slice/Ice/ConnectionF.ice +0 -33
- slice/Ice/Current.ice +0 -170
- slice/Ice/Endpoint.ice +0 -291
- slice/Ice/EndpointF.ice +0 -43
- slice/Ice/FacetMap.ice +0 -36
- slice/Ice/ImplicitContext.ice +0 -119
- slice/Ice/ImplicitContextF.ice +0 -30
- slice/Ice/Instrumentation.ice +0 -509
- slice/Ice/InstrumentationF.ice +0 -38
- slice/Ice/LocalException.ice +0 -1040
- slice/Ice/LocatorF.ice +0 -32
- slice/Ice/Logger.ice +0 -99
- slice/Ice/LoggerF.ice +0 -31
- slice/Ice/ObjectAdapter.ice +0 -710
- slice/Ice/ObjectAdapterF.ice +0 -31
- slice/Ice/ObjectFactory.ice +0 -71
- slice/Ice/Plugin.ice +0 -131
- slice/Ice/PluginF.ice +0 -36
- slice/Ice/ProcessF.ice +0 -31
- slice/Ice/Properties.ice +0 -244
- slice/Ice/PropertiesF.ice +0 -32
- slice/Ice/RouterF.ice +0 -31
- slice/Ice/ServantLocator.ice +0 -136
- slice/Ice/ServantLocatorF.ice +0 -31
- slice/Ice/ValueFactory.ice +0 -133
- slice/IceBT/ConnectionInfo.ice +0 -59
- slice/IceBT/EndpointInfo.ice +0 -57
- slice/IceBT/Types.ice +0 -45
- slice/IceBox/IceBox.ice +0 -216
- slice/IceDiscovery/IceDiscovery.ice +0 -98
- slice/IceGrid/PluginFacade.ice +0 -329
- slice/IceIAP/ConnectionInfo.ice +0 -74
- slice/IceIAP/EndpointInfo.ice +0 -68
- slice/IceLocatorDiscovery/IceLocatorDiscovery.ice +0 -83
- slice/IcePatch2/FileInfo.ice +0 -85
- slice/IcePatch2/FileServer.ice +0 -191
- slice/IceSSL/ConnectionInfo.ice +0 -54
- slice/IceSSL/ConnectionInfoF.ice +0 -31
- slice/IceSSL/EndpointInfo.ice +0 -45
- zeroc_ice-3.7.10.1.dist-info/LICENSE +0 -340
- zeroc_ice-3.7.10.1.dist-info/METADATA +0 -97
- zeroc_ice-3.7.10.1.dist-info/RECORD +0 -145
- {zeroc_ice-3.7.10.1.dist-info → zeroc_ice-3.8.0.dist-info}/entry_points.txt +0 -0
Ice/Dispatch.py
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Copyright (c) ZeroC, Inc.
|
|
2
|
+
|
|
3
|
+
import inspect
|
|
4
|
+
from collections.abc import Callable, Coroutine
|
|
5
|
+
from typing import Any, cast
|
|
6
|
+
|
|
7
|
+
import IcePy
|
|
8
|
+
|
|
9
|
+
from .Future import FutureLike
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def is_future(obj: object) -> bool:
|
|
13
|
+
return callable(getattr(obj, "add_done_callback", None))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def dispatch(cb: IcePy.DispatchCallback, method: Callable, args: list[Any]):
|
|
17
|
+
"""
|
|
18
|
+
Dispatch a request to the given servant method.
|
|
19
|
+
|
|
20
|
+
This function is called by IcePy from an Ice server thread pool thread to dispatch a request to a servant method
|
|
21
|
+
with the given arguments. The method's result is then sent back to IcePy using the provided callback.
|
|
22
|
+
|
|
23
|
+
The method parameter can return:
|
|
24
|
+
- A direct result, which is immediately sent back via the callback.
|
|
25
|
+
- A coroutine.
|
|
26
|
+
- A future.
|
|
27
|
+
|
|
28
|
+
If the result is a coroutine and the Ice communicator has a custom coroutine executor, dispatch uses the executor to
|
|
29
|
+
execute the coroutine, and uses the resulting future to wait for dispatch completion.
|
|
30
|
+
|
|
31
|
+
Parameters
|
|
32
|
+
----------
|
|
33
|
+
cb : IcePy.DispatchCallback
|
|
34
|
+
The callback used to return the result or report an exception to IcePy.
|
|
35
|
+
method : Callable
|
|
36
|
+
The servant method to invoke. This method is bound to the servant instance and takes the request parameters as
|
|
37
|
+
arguments.
|
|
38
|
+
args : list
|
|
39
|
+
The request parameters.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
# Invoke the servant method with the request parameters. Let exceptions propagate to the caller.
|
|
43
|
+
result = method(*args)
|
|
44
|
+
|
|
45
|
+
# If the result is a coroutine and the communicator has a custom coroutine executor, execute the coroutine using
|
|
46
|
+
# the configured coroutine executor.
|
|
47
|
+
if inspect.iscoroutine(result):
|
|
48
|
+
assert len(args) > 0, "args must have at least one argument, current"
|
|
49
|
+
current = args[-1]
|
|
50
|
+
eventLoopAdapter = current.adapter.getCommunicator().eventLoopAdapter
|
|
51
|
+
if eventLoopAdapter:
|
|
52
|
+
result = eventLoopAdapter.runCoroutine(result)
|
|
53
|
+
if not is_future(result):
|
|
54
|
+
raise TypeError("The runCoroutine implementation must return a Future-like object")
|
|
55
|
+
|
|
56
|
+
# If the result is a future, attach a done callback to handle dispatch completion.
|
|
57
|
+
if is_future(result):
|
|
58
|
+
# Use a more precise type annotation while maintaining runtime behavior.
|
|
59
|
+
result = cast(FutureLike, result)
|
|
60
|
+
|
|
61
|
+
def handle_future_result(future: FutureLike):
|
|
62
|
+
try:
|
|
63
|
+
cb.response(future.result())
|
|
64
|
+
except BaseException as ex:
|
|
65
|
+
cb.exception(ex)
|
|
66
|
+
|
|
67
|
+
result.add_done_callback(handle_future_result)
|
|
68
|
+
|
|
69
|
+
# If the result is a coroutine and no custom coroutine executor is available, run the coroutine synchronously in
|
|
70
|
+
# the current thread using run_coroutine helper function.
|
|
71
|
+
elif inspect.iscoroutine(result):
|
|
72
|
+
run_coroutine(cb, result)
|
|
73
|
+
|
|
74
|
+
# Otherwise, return the result directly.
|
|
75
|
+
else:
|
|
76
|
+
cb.response(result)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def run_coroutine(
|
|
80
|
+
cb: IcePy.DispatchCallback,
|
|
81
|
+
coroutine: Coroutine[Any, Any, Any],
|
|
82
|
+
value: object | None = None,
|
|
83
|
+
exception: BaseException | None = None,
|
|
84
|
+
):
|
|
85
|
+
"""
|
|
86
|
+
Run a coroutine until completion.
|
|
87
|
+
|
|
88
|
+
This function is invoked by the `dispatch` function to execute coroutines when no custom coroutine executor is
|
|
89
|
+
configured.
|
|
90
|
+
|
|
91
|
+
Unlike a general-purpose executor, this function is specifically designed for handling coroutines produced by
|
|
92
|
+
AMI calls nested in AMD dispatch.
|
|
93
|
+
|
|
94
|
+
.. code-block:: python
|
|
95
|
+
|
|
96
|
+
async def op(self, current: Ice.Current):
|
|
97
|
+
await self.prox.ice_pingAsync()
|
|
98
|
+
"""
|
|
99
|
+
try:
|
|
100
|
+
if exception:
|
|
101
|
+
result = coroutine.throw(exception)
|
|
102
|
+
else:
|
|
103
|
+
result = coroutine.send(value)
|
|
104
|
+
|
|
105
|
+
if is_future(result):
|
|
106
|
+
|
|
107
|
+
def handle_future_result(future: FutureLike):
|
|
108
|
+
try:
|
|
109
|
+
run_coroutine(cb, coroutine, value=future.result())
|
|
110
|
+
except BaseException as ex:
|
|
111
|
+
run_coroutine(cb, coroutine, exception=ex)
|
|
112
|
+
|
|
113
|
+
# There is a potential recursive call here if the future is already completed.
|
|
114
|
+
# However, synchronous completion of AMI calls is rare, and this executor is specifically
|
|
115
|
+
# designed for AMI calls nested in AMD dispatch.
|
|
116
|
+
result.add_done_callback(handle_future_result)
|
|
117
|
+
else:
|
|
118
|
+
raise RuntimeError(f"unexpected value of type {type(result)} returned by coroutine.send()")
|
|
119
|
+
except StopIteration as ex:
|
|
120
|
+
cb.response(ex.value)
|
|
121
|
+
except BaseException as ex:
|
|
122
|
+
cb.exception(ex)
|
Ice/DoubleSeq.py
ADDED
Ice/EncodingVersion.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Copyright (c) ZeroC, Inc.
|
|
2
|
+
|
|
3
|
+
# slice2py version 3.8.0
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
import IcePy
|
|
7
|
+
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(order=True, unsafe_hash=True)
|
|
12
|
+
class EncodingVersion:
|
|
13
|
+
"""
|
|
14
|
+
Represents a version of the Slice encoding. Ice supports version 1.0 and 1.1 of this encoding.
|
|
15
|
+
|
|
16
|
+
Attributes
|
|
17
|
+
----------
|
|
18
|
+
major : int
|
|
19
|
+
The major version of the Slice encoding.
|
|
20
|
+
minor : int
|
|
21
|
+
The minor version of the Slice encoding.
|
|
22
|
+
|
|
23
|
+
Notes
|
|
24
|
+
-----
|
|
25
|
+
The Slice encoding is also known as the Ice encoding.
|
|
26
|
+
|
|
27
|
+
The Slice compiler generated this dataclass from Slice struct ``::Ice::EncodingVersion``.
|
|
28
|
+
"""
|
|
29
|
+
major: int = 0
|
|
30
|
+
minor: int = 0
|
|
31
|
+
|
|
32
|
+
_Ice_EncodingVersion_t = IcePy.defineStruct(
|
|
33
|
+
"::Ice::EncodingVersion",
|
|
34
|
+
EncodingVersion,
|
|
35
|
+
(),
|
|
36
|
+
(
|
|
37
|
+
("major", (), IcePy._t_byte),
|
|
38
|
+
("minor", (), IcePy._t_byte)
|
|
39
|
+
))
|
|
40
|
+
|
|
41
|
+
__all__ = ["EncodingVersion", "_Ice_EncodingVersion_t"]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Copyright (c) ZeroC, Inc.
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class EndpointSelectionType(Enum):
|
|
7
|
+
"""
|
|
8
|
+
Determines the order in which the Ice runtime uses the endpoints in a proxy when establishing a connection.
|
|
9
|
+
|
|
10
|
+
Enumerators
|
|
11
|
+
-----------
|
|
12
|
+
Random : EndpointSelectionType
|
|
13
|
+
Random causes the endpoints to be arranged in a random order.
|
|
14
|
+
Ordered : EndpointSelectionType
|
|
15
|
+
Ordered forces the Ice runtime to use the endpoints in the order they appeared in the proxy.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
Random = 0
|
|
19
|
+
Ordered = 1
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
__all__ = ["EndpointSelectionType"]
|
Ice/EventLoopAdapter.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Copyright (c) ZeroC, Inc.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from abc import ABC, abstractmethod
|
|
6
|
+
from collections.abc import Awaitable, Coroutine
|
|
7
|
+
from typing import TYPE_CHECKING
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from .Future import Future, FutureLike
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class EventLoopAdapter(ABC):
|
|
14
|
+
"""
|
|
15
|
+
An adapter that allows applications to execute asynchronous code in a custom event loop.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
@abstractmethod
|
|
19
|
+
def runCoroutine(self, coroutine: Coroutine) -> FutureLike:
|
|
20
|
+
"""
|
|
21
|
+
Run a coroutine in the application configured event loop. The Ice run time will call this method to run
|
|
22
|
+
coroutines returned by async dispatch methods. This method is called from the Ice dispatch thread.
|
|
23
|
+
|
|
24
|
+
Parameters
|
|
25
|
+
----------
|
|
26
|
+
coroutine : Coroutine
|
|
27
|
+
The coroutine to run.
|
|
28
|
+
|
|
29
|
+
Returns
|
|
30
|
+
-------
|
|
31
|
+
FutureLike
|
|
32
|
+
A Future-like object that can be used to wait for the completion of the coroutine.
|
|
33
|
+
"""
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
@abstractmethod
|
|
37
|
+
def wrapFuture(self, future: Future) -> Awaitable:
|
|
38
|
+
"""
|
|
39
|
+
Wraps an Ice.Future so that it can be awaited in the application event loop. The Ice run time calls this method
|
|
40
|
+
before returning a future to the application.
|
|
41
|
+
|
|
42
|
+
Parameters
|
|
43
|
+
----------
|
|
44
|
+
future : Ice.Future
|
|
45
|
+
The future to wrap.
|
|
46
|
+
|
|
47
|
+
Returns
|
|
48
|
+
-------
|
|
49
|
+
Awaitable
|
|
50
|
+
An awaitable object that can be awaited in the application event loop.
|
|
51
|
+
"""
|
|
52
|
+
pass
|
Ice/Exception.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Copyright (c) ZeroC, Inc.
|
|
2
|
+
|
|
3
|
+
from builtins import Exception as BuiltinsException
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Exception(BuiltinsException):
|
|
7
|
+
"""
|
|
8
|
+
The base class for all Ice exceptions.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
_ice_id: str
|
|
12
|
+
|
|
13
|
+
def ice_id(self):
|
|
14
|
+
"""
|
|
15
|
+
Return the type ID of this exception.
|
|
16
|
+
|
|
17
|
+
For exceptions defined in Slice, this corresponds to the Slice type ID.
|
|
18
|
+
For other exceptions, it is a fully scoped name in the same format.
|
|
19
|
+
For example: "::Ice::CommunicatorDestroyedException".
|
|
20
|
+
|
|
21
|
+
Returns
|
|
22
|
+
-------
|
|
23
|
+
str
|
|
24
|
+
The type ID of the exception.
|
|
25
|
+
"""
|
|
26
|
+
return self._ice_id
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
__all__ = ["Exception"]
|
Ice/FloatSeq.py
ADDED
Ice/FormatType.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Copyright (c) ZeroC, Inc.
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class FormatType(Enum):
|
|
7
|
+
"""
|
|
8
|
+
This enumeration describes the possible formats for classes and exceptions.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
CompactFormat = 0
|
|
12
|
+
SlicedFormat = 1
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
__all__ = ["FormatType"]
|
Ice/Future.py
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
# Copyright (c) ZeroC, Inc.
|
|
2
|
+
|
|
3
|
+
import asyncio
|
|
4
|
+
import logging
|
|
5
|
+
import threading
|
|
6
|
+
import time
|
|
7
|
+
from collections.abc import Awaitable, Callable, Generator
|
|
8
|
+
from typing import Any, Protocol, Self, TypeVar, overload
|
|
9
|
+
|
|
10
|
+
from .LocalExceptions import InvocationCanceledException, TimeoutException
|
|
11
|
+
|
|
12
|
+
# Type variable for the result type of the Future
|
|
13
|
+
_T = TypeVar("_T")
|
|
14
|
+
_T_co = TypeVar("_T_co", covariant=True)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Future(Awaitable[_T]):
|
|
18
|
+
"""
|
|
19
|
+
A Future object representing the result of an asynchronous operation.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
def __init__(self):
|
|
23
|
+
self._result: _T | None = None
|
|
24
|
+
self._exception: BaseException | None = None
|
|
25
|
+
self._condition = threading.Condition()
|
|
26
|
+
self._doneCallbacks = []
|
|
27
|
+
self._state = Future.StateRunning
|
|
28
|
+
|
|
29
|
+
def __await__(self) -> Generator[Any, None, _T]:
|
|
30
|
+
if not self.done():
|
|
31
|
+
yield self
|
|
32
|
+
return self.result()
|
|
33
|
+
|
|
34
|
+
def cancel(self):
|
|
35
|
+
"""
|
|
36
|
+
Attempt to cancel the operation.
|
|
37
|
+
|
|
38
|
+
If the operation is already running or has completed, it cannot be cancelled, and the method returns False.
|
|
39
|
+
Otherwise, the operation is cancelled, and the method returns True.
|
|
40
|
+
|
|
41
|
+
Returns
|
|
42
|
+
-------
|
|
43
|
+
bool
|
|
44
|
+
True if the operation was cancelled, False otherwise.
|
|
45
|
+
"""
|
|
46
|
+
callbacks = []
|
|
47
|
+
with self._condition:
|
|
48
|
+
if self._state == Future.StateDone:
|
|
49
|
+
return False
|
|
50
|
+
|
|
51
|
+
if self._state == Future.StateCancelled:
|
|
52
|
+
return True
|
|
53
|
+
|
|
54
|
+
self._state = Future.StateCancelled
|
|
55
|
+
callbacks = self._doneCallbacks
|
|
56
|
+
self._doneCallbacks = []
|
|
57
|
+
self._condition.notify_all()
|
|
58
|
+
|
|
59
|
+
self._callCallbacks(callbacks)
|
|
60
|
+
|
|
61
|
+
return True
|
|
62
|
+
|
|
63
|
+
def cancelled(self):
|
|
64
|
+
"""
|
|
65
|
+
Check if the future has been cancelled.
|
|
66
|
+
|
|
67
|
+
Returns
|
|
68
|
+
-------
|
|
69
|
+
bool
|
|
70
|
+
True if the future was cancelled using `cancel()`, otherwise False.
|
|
71
|
+
"""
|
|
72
|
+
with self._condition:
|
|
73
|
+
return self._state == Future.StateCancelled
|
|
74
|
+
|
|
75
|
+
def running(self):
|
|
76
|
+
"""
|
|
77
|
+
Check if the future is still running.
|
|
78
|
+
|
|
79
|
+
Returns
|
|
80
|
+
-------
|
|
81
|
+
bool
|
|
82
|
+
True if the operation is currently executing and cannot be cancelled,
|
|
83
|
+
otherwise False.
|
|
84
|
+
"""
|
|
85
|
+
with self._condition:
|
|
86
|
+
return self._state == Future.StateRunning
|
|
87
|
+
|
|
88
|
+
def done(self):
|
|
89
|
+
"""
|
|
90
|
+
Check if the future has completed or been cancelled.
|
|
91
|
+
|
|
92
|
+
Returns
|
|
93
|
+
-------
|
|
94
|
+
bool
|
|
95
|
+
True if the operation has completed (successfully or with an exception)
|
|
96
|
+
or has been cancelled, otherwise False.
|
|
97
|
+
"""
|
|
98
|
+
with self._condition:
|
|
99
|
+
return self._state in [Future.StateCancelled, Future.StateDone]
|
|
100
|
+
|
|
101
|
+
def add_done_callback(self, fn: Callable) -> None:
|
|
102
|
+
"""
|
|
103
|
+
Attach a callback to be executed when the future completes.
|
|
104
|
+
|
|
105
|
+
The callback `fn` is called with the future as its only argument once the future completes or is cancelled.
|
|
106
|
+
Registered callbacks are executed in the order they were added.
|
|
107
|
+
|
|
108
|
+
If the future is already complete, `fn` is called immediately from the calling thread.
|
|
109
|
+
|
|
110
|
+
Parameters
|
|
111
|
+
----------
|
|
112
|
+
fn : callable
|
|
113
|
+
The function to execute upon completion. Takes the future as its argument.
|
|
114
|
+
"""
|
|
115
|
+
with self._condition:
|
|
116
|
+
if self._state == Future.StateRunning:
|
|
117
|
+
self._doneCallbacks.append(fn)
|
|
118
|
+
return
|
|
119
|
+
fn(self)
|
|
120
|
+
|
|
121
|
+
def result(self, timeout: int | float | None = None) -> _T:
|
|
122
|
+
"""
|
|
123
|
+
Retrieve the result of the future.
|
|
124
|
+
|
|
125
|
+
If the operation has not completed, this method waits up to `timeout` seconds for it to finish. If the
|
|
126
|
+
timeout is reached, a `TimeoutException` is raised.
|
|
127
|
+
|
|
128
|
+
If the future was cancelled before completing, an `InvocationCanceledException` is raised.
|
|
129
|
+
|
|
130
|
+
If the operation raised an exception, this method raises the same exception.
|
|
131
|
+
|
|
132
|
+
Parameters
|
|
133
|
+
----------
|
|
134
|
+
timeout : int | float, optional
|
|
135
|
+
Maximum time (in seconds) to wait for the result. If `None`, the method waits indefinitely until the
|
|
136
|
+
operation completes.
|
|
137
|
+
|
|
138
|
+
Returns
|
|
139
|
+
-------
|
|
140
|
+
object
|
|
141
|
+
The result of the operation.
|
|
142
|
+
|
|
143
|
+
Raises
|
|
144
|
+
------
|
|
145
|
+
TimeoutException
|
|
146
|
+
If the operation has not completed within the specified timeout.
|
|
147
|
+
InvocationCanceledException
|
|
148
|
+
If the operation was cancelled before completing.
|
|
149
|
+
Exception
|
|
150
|
+
If the operation raised an exception.
|
|
151
|
+
"""
|
|
152
|
+
with self._condition:
|
|
153
|
+
if not self._wait(timeout, lambda: self._state == Future.StateRunning):
|
|
154
|
+
raise TimeoutException()
|
|
155
|
+
|
|
156
|
+
if self._state == Future.StateCancelled:
|
|
157
|
+
raise InvocationCanceledException()
|
|
158
|
+
elif self._exception:
|
|
159
|
+
raise self._exception
|
|
160
|
+
else:
|
|
161
|
+
# We can't check if _result is None here, because it is valid to have a result of None.
|
|
162
|
+
# i.e. Future[None]
|
|
163
|
+
return self._result # type: ignore[return-value]
|
|
164
|
+
|
|
165
|
+
def exception(self, timeout: int | float | None = None) -> BaseException | None:
|
|
166
|
+
"""
|
|
167
|
+
Retrieve the exception raised by the operation.
|
|
168
|
+
|
|
169
|
+
If the operation has not completed, this method waits up to `timeout` seconds for it to finish. If the timeout
|
|
170
|
+
is reached, a `TimeoutException` is raised.
|
|
171
|
+
|
|
172
|
+
If the future was cancelled before completing, an `InvocationCanceledException` is raised.
|
|
173
|
+
|
|
174
|
+
If the operation completed successfully without raising an exception, `None` is returned.
|
|
175
|
+
|
|
176
|
+
Parameters
|
|
177
|
+
----------
|
|
178
|
+
timeout : int | float, optional
|
|
179
|
+
Maximum time (in seconds) to wait for the exception. If `None`, the method waits indefinitely until the
|
|
180
|
+
operation completes.
|
|
181
|
+
|
|
182
|
+
Returns
|
|
183
|
+
-------
|
|
184
|
+
BaseException or None
|
|
185
|
+
The exception raised by the operation, or `None` if the operation completed successfully.
|
|
186
|
+
|
|
187
|
+
Raises
|
|
188
|
+
------
|
|
189
|
+
TimeoutException
|
|
190
|
+
If the operation has not completed within the specified timeout.
|
|
191
|
+
InvocationCanceledException
|
|
192
|
+
If the operation was cancelled before completing.
|
|
193
|
+
"""
|
|
194
|
+
with self._condition:
|
|
195
|
+
if not self._wait(timeout, lambda: self._state == Future.StateRunning):
|
|
196
|
+
raise TimeoutException()
|
|
197
|
+
if self._state == Future.StateCancelled:
|
|
198
|
+
raise InvocationCanceledException()
|
|
199
|
+
else:
|
|
200
|
+
return self._exception
|
|
201
|
+
|
|
202
|
+
def set_result(self, result: _T):
|
|
203
|
+
"""
|
|
204
|
+
Set the result of the future and mark it as completed.
|
|
205
|
+
|
|
206
|
+
This method stores the provided `result` and transitions the future's state to "done". Any registered
|
|
207
|
+
callbacks are executed after the state update.
|
|
208
|
+
|
|
209
|
+
If the future is not in a running state, this method has no effect.
|
|
210
|
+
|
|
211
|
+
Parameters
|
|
212
|
+
----------
|
|
213
|
+
result : object
|
|
214
|
+
The result value to store in the future.
|
|
215
|
+
"""
|
|
216
|
+
callbacks = []
|
|
217
|
+
with self._condition:
|
|
218
|
+
if self._state != Future.StateRunning:
|
|
219
|
+
return
|
|
220
|
+
self._result = result
|
|
221
|
+
self._state = Future.StateDone
|
|
222
|
+
callbacks = self._doneCallbacks
|
|
223
|
+
self._doneCallbacks = []
|
|
224
|
+
self._condition.notify_all()
|
|
225
|
+
|
|
226
|
+
self._callCallbacks(callbacks)
|
|
227
|
+
|
|
228
|
+
def set_exception(self, ex: BaseException):
|
|
229
|
+
"""
|
|
230
|
+
Set an exception for the future and mark it as completed.
|
|
231
|
+
|
|
232
|
+
This method stores the provided exception `ex` and transitions the future's state to "done". Any registered
|
|
233
|
+
callbacks are executed after the state update.
|
|
234
|
+
|
|
235
|
+
If the future is not in a running state, this method has no effect.
|
|
236
|
+
|
|
237
|
+
Parameters
|
|
238
|
+
----------
|
|
239
|
+
ex : BaseException
|
|
240
|
+
The exception to store in the future.
|
|
241
|
+
"""
|
|
242
|
+
callbacks = []
|
|
243
|
+
with self._condition:
|
|
244
|
+
if self._state != Future.StateRunning:
|
|
245
|
+
return
|
|
246
|
+
self._exception = ex
|
|
247
|
+
self._state = Future.StateDone
|
|
248
|
+
callbacks = self._doneCallbacks
|
|
249
|
+
self._doneCallbacks = []
|
|
250
|
+
self._condition.notify_all()
|
|
251
|
+
self._callCallbacks(callbacks)
|
|
252
|
+
|
|
253
|
+
@staticmethod
|
|
254
|
+
def completed(result: _T) -> "Future[_T]":
|
|
255
|
+
f = Future()
|
|
256
|
+
f.set_result(result)
|
|
257
|
+
return f
|
|
258
|
+
|
|
259
|
+
def _wait(self, timeout: float | None, testFn: Callable[[], bool]) -> bool:
|
|
260
|
+
# Must be called with _condition acquired
|
|
261
|
+
|
|
262
|
+
while testFn():
|
|
263
|
+
if timeout:
|
|
264
|
+
start = time.time()
|
|
265
|
+
self._condition.wait(timeout)
|
|
266
|
+
# Subtract the elapsed time so far from the timeout
|
|
267
|
+
timeout -= time.time() - start
|
|
268
|
+
if timeout <= 0:
|
|
269
|
+
return False
|
|
270
|
+
else:
|
|
271
|
+
self._condition.wait()
|
|
272
|
+
|
|
273
|
+
return True
|
|
274
|
+
|
|
275
|
+
def _callCallbacks(self, callbacks: list[Callable[[Self], None]]):
|
|
276
|
+
for callback in callbacks:
|
|
277
|
+
try:
|
|
278
|
+
callback(self)
|
|
279
|
+
except Exception:
|
|
280
|
+
logging.getLogger("Ice.Future").exception("done callback raised exception")
|
|
281
|
+
|
|
282
|
+
StateRunning = "running"
|
|
283
|
+
StateCancelled = "cancelled"
|
|
284
|
+
StateDone = "done"
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
def wrap_future(future: Future | asyncio.Future, *, loop: asyncio.AbstractEventLoop | None = None) -> asyncio.Future:
|
|
288
|
+
"""
|
|
289
|
+
Wrap an :class:`Ice.Future` object into an ``asyncio.Future``.
|
|
290
|
+
|
|
291
|
+
This function converts an Ice.Future into an asyncio.Future to allow integration of Ice's
|
|
292
|
+
asynchronous operations with Python's asyncio framework. If the provided future is already
|
|
293
|
+
an asyncio.Future, it is returned unchanged.
|
|
294
|
+
|
|
295
|
+
If the Ice.Future is already completed, the asyncio.Future is immediately resolved. Otherwise,
|
|
296
|
+
completion callbacks are registered to ensure that the asyncio.Future reflects the state of the
|
|
297
|
+
Ice.Future, including result propagation, exception handling, and cancellation.
|
|
298
|
+
|
|
299
|
+
Parameters
|
|
300
|
+
----------
|
|
301
|
+
future : Future | asyncio.Future
|
|
302
|
+
The Ice.Future object to wrap. If an asyncio.Future is passed, it is returned as-is.
|
|
303
|
+
|
|
304
|
+
loop : asyncio.AbstractEventLoop, optional
|
|
305
|
+
The event loop to associate with the asyncio.Future. If not provided, the current event loop
|
|
306
|
+
is used.
|
|
307
|
+
|
|
308
|
+
Returns
|
|
309
|
+
-------
|
|
310
|
+
asyncio.Future
|
|
311
|
+
A future that mirrors the state of the input Ice.Future.
|
|
312
|
+
|
|
313
|
+
Raises
|
|
314
|
+
------
|
|
315
|
+
AssertionError
|
|
316
|
+
If `future` is not an instance of Ice.Future or asyncio.Future.
|
|
317
|
+
"""
|
|
318
|
+
|
|
319
|
+
if isinstance(future, asyncio.Future):
|
|
320
|
+
return future
|
|
321
|
+
|
|
322
|
+
assert isinstance(future, Future), "Ice.Future is expected, got {!r}".format(future)
|
|
323
|
+
|
|
324
|
+
@overload
|
|
325
|
+
def forwardCompletion(sourceFuture: Future, targetFuture: asyncio.Future): ...
|
|
326
|
+
|
|
327
|
+
@overload
|
|
328
|
+
def forwardCompletion(sourceFuture: asyncio.Future, targetFuture: Future): ...
|
|
329
|
+
|
|
330
|
+
def forwardCompletion(sourceFuture: Future | asyncio.Future, targetFuture: Future | asyncio.Future):
|
|
331
|
+
if not targetFuture.done():
|
|
332
|
+
if sourceFuture.cancelled():
|
|
333
|
+
targetFuture.cancel()
|
|
334
|
+
elif (sourceException := sourceFuture.exception()) is not None:
|
|
335
|
+
targetFuture.set_exception(sourceException)
|
|
336
|
+
else:
|
|
337
|
+
targetFuture.set_result(sourceFuture.result())
|
|
338
|
+
|
|
339
|
+
if loop is None:
|
|
340
|
+
loop = asyncio.get_event_loop()
|
|
341
|
+
asyncioFuture = loop.create_future()
|
|
342
|
+
|
|
343
|
+
if future.done():
|
|
344
|
+
# As long as no done callbacks are registered, completing the asyncio future should be thread safe
|
|
345
|
+
# even if the future is constructed with a loop which isn't the current thread's loop.
|
|
346
|
+
forwardCompletion(future, asyncioFuture)
|
|
347
|
+
else:
|
|
348
|
+
asyncioFuture.add_done_callback(lambda f: forwardCompletion(asyncioFuture, future))
|
|
349
|
+
future.add_done_callback(lambda f: loop.call_soon_threadsafe(forwardCompletion, future, asyncioFuture))
|
|
350
|
+
|
|
351
|
+
return asyncioFuture
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
class FutureLike(Protocol[_T_co]):
|
|
355
|
+
"""A protocol that defines the interface for objects that behave like a Future."""
|
|
356
|
+
|
|
357
|
+
def add_done_callback(self, callback: Callable[["FutureLike"], Any], /) -> None:
|
|
358
|
+
"""Add a callback to be run when the Future is done.
|
|
359
|
+
|
|
360
|
+
Args:
|
|
361
|
+
callback: A callable that takes the Future object as its only argument.
|
|
362
|
+
Will be called when the Future completes (successfully,
|
|
363
|
+
with exception, or cancelled).
|
|
364
|
+
|
|
365
|
+
Note: Using positional-only parameter (/) to match both asyncio and
|
|
366
|
+
concurrent.futures implementations regardless of parameter name.
|
|
367
|
+
"""
|
|
368
|
+
...
|
|
369
|
+
|
|
370
|
+
def result(self, timeout: int | float | None = None) -> _T_co:
|
|
371
|
+
"""Return the result of the Future."""
|
|
372
|
+
...
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
__all__ = ["Future", "wrap_future", "FutureLike"]
|