vortexpy 4.0.20__tar.gz → 4.0.22__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.
- {vortexpy-4.0.20 → vortexpy-4.0.22}/PKG-INFO +1 -1
- {vortexpy-4.0.20 → vortexpy-4.0.22}/pyproject.toml +1 -1
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/PayloadEnvelope.py +1 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/Tuple.py +1 -1
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexClientWebsocketFactory.py +9 -6
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexFactory.py +8 -6
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexPayloadProtocol.py +11 -14
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexServer.py +3 -1
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexServerWebsocket.py +63 -13
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/__init__.py +1 -1
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortexpy.egg-info/PKG-INFO +1 -1
- {vortexpy-4.0.20 → vortexpy-4.0.22}/LICENSE +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/README.md +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/setup.cfg +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/DataWrapTuple.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/DeferUtil.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/Jsonable.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/Payload.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/PayloadEndpoint.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/PayloadEndpointTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/PayloadFilterKeys.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/PayloadIO.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/PayloadPriority.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/PayloadResponse.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/PayloadResponseTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/PayloadTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/PerformTestActionTuple.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/SerialiseUtil.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/TestTuple.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/TupleAction.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/TupleActionVortex.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/TupleDataForTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/TuplePerfTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/TuplePolymorphicTupleTypeFieldArgTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/TupleRestfulTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/TupleSelector.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/TupleTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexABC.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexClientHttp.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexClientHttpTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexClientTcp.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexConnectionABC.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexServerConnection.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexServerHttpResource.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexServerTcp.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexTcpMemoryLeakPayloadTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexTcpMemoryLeakRawTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexUtil.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/VortexWritePushProducer.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/data_loader/TupleDataLiveLockManager.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/data_loader/TupleDataLoader.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/data_loader/TupleDataLoaderDelegate.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/data_loader/TupleDataLoaderTupleABC.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/data_loader/TupleDataLoaderTuples.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/data_loader/__init__.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/event_bus/TupleChangeEventABC.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/event_bus/TupleChangeEventBus.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/event_bus/TupleChangeEventBusObserverABC.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/event_bus/__init__.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/handler/TupleActionProcessor.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/handler/TupleActionProcessorProxy.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/handler/TupleActionProcessorTestHandler.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/handler/TupleDataActionClient.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/handler/TupleDataObservableCache.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/handler/TupleDataObservableHandler.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/handler/TupleDataObservableProxyHandler.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/handler/TupleDataObservableTestHandler.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/handler/TupleDataObserverClient.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/handler/VortexJSTupleLoaderTestHandler.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/handler/__init__.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/restful/GzippedDataHttpClient.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/restful/GzippedDataHttpClientTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/restful/GzippedPayloadHttpClient.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/restful/RestfulHttpClient.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/restful/RestfulHttpClientTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/restful/RestfulResource.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/restful/RestfulResourceTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/restful/__init__.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/rpc/RPC.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/rpc/RPCTest.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/rpc/__init__.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/sqla_orm/OrmCrudHandler.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/sqla_orm/TupleProviderForDb.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/sqla_orm/VortexTupleJson.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/sqla_orm/__init__.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/storage/TupleStorageSqlite.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortex/storage/__init__.py +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortexpy.egg-info/SOURCES.txt +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortexpy.egg-info/dependency_links.txt +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortexpy.egg-info/requires.txt +0 -0
- {vortexpy-4.0.20 → vortexpy-4.0.22}/vortexpy.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "vortexpy"
|
|
7
|
-
version = "4.0.
|
|
7
|
+
version = "4.0.22"
|
|
8
8
|
authors = [{name = "Synerty", email = "contact@synerty.com"}]
|
|
9
9
|
description = "Synertys observable, routable, data serialisation and transport code."
|
|
10
10
|
keywords = [
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Website : http://www.synerty.com
|
|
7
7
|
* Support : support@synerty.com
|
|
8
8
|
"""
|
|
9
|
+
|
|
9
10
|
import logging
|
|
10
11
|
import uuid
|
|
11
12
|
from collections import deque, namedtuple
|
|
@@ -317,12 +318,14 @@ class VortexClientWebsocketFactory(
|
|
|
317
318
|
assert self._server
|
|
318
319
|
assert vortexMsgs
|
|
319
320
|
|
|
320
|
-
#
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
vortexMsg
|
|
325
|
-
|
|
321
|
+
# If this transport requires base64 encoding
|
|
322
|
+
if self.requiresBase64Encoding:
|
|
323
|
+
for index, vortexMsg in enumerate(vortexMsgs):
|
|
324
|
+
if vortexMsg.startswith(b"{"):
|
|
325
|
+
vortexMsg = yield PayloadEnvelope.base64EncodeDefer(
|
|
326
|
+
vortexMsg
|
|
327
|
+
)
|
|
328
|
+
vortexMsgs[index] = vortexMsg + b"."
|
|
326
329
|
|
|
327
330
|
for vortexMsg in vortexMsgs:
|
|
328
331
|
self.__protocol.write(vortexMsg)
|
|
@@ -207,9 +207,9 @@ class _VortexFactoryVortexInfo:
|
|
|
207
207
|
|
|
208
208
|
self.__remoteVortexNameByUuid: dict[str, tuple[VortexABC, str]] = {}
|
|
209
209
|
|
|
210
|
-
self.__localVortexUuidsByName: dict[
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
self.__localVortexUuidsByName: dict[str, set[tuple[VortexABC, str]]] = (
|
|
211
|
+
defaultdict(set)
|
|
212
|
+
)
|
|
213
213
|
|
|
214
214
|
self.__localVortexNameByUuid: dict[str, tuple[VortexABC, str]] = {}
|
|
215
215
|
|
|
@@ -828,12 +828,14 @@ class VortexFactory:
|
|
|
828
828
|
base64VortexMsgs = vortexMsgs[:]
|
|
829
829
|
|
|
830
830
|
# If any transports require base64 encoding, then encode them all
|
|
831
|
+
|
|
831
832
|
if [v for v in vortexAndUuids if v[0].requiresBase64Encoding]:
|
|
832
833
|
for index, vortexMsg in enumerate(base64VortexMsgs):
|
|
833
834
|
if vortexMsg.startswith(b"{"):
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
835
|
+
base64VortexMsg = yield PayloadEnvelope.base64EncodeDefer(
|
|
836
|
+
vortexMsg
|
|
837
|
+
)
|
|
838
|
+
base64VortexMsgs[index] = base64VortexMsg + b"."
|
|
837
839
|
|
|
838
840
|
deferreds = []
|
|
839
841
|
for vortex, uuid in vortexAndUuids:
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Website : http://www.synerty.com
|
|
7
7
|
* Support : support@synerty.com
|
|
8
8
|
"""
|
|
9
|
+
|
|
9
10
|
import logging
|
|
10
11
|
from abc import ABCMeta, abstractmethod
|
|
11
12
|
from collections import deque
|
|
@@ -24,12 +25,11 @@ logger = logging.getLogger(name=__name__)
|
|
|
24
25
|
|
|
25
26
|
class VortexPayloadProtocol(Protocol, metaclass=ABCMeta):
|
|
26
27
|
def __init__(self, logger):
|
|
27
|
-
self._data = b""
|
|
28
28
|
self._serverVortexUuid = None
|
|
29
29
|
self._serverVortexName = None
|
|
30
30
|
self._logger = logger
|
|
31
31
|
|
|
32
|
-
self.
|
|
32
|
+
self._data = b""
|
|
33
33
|
self._vortexMsgsQueue = deque()
|
|
34
34
|
|
|
35
35
|
@abstractmethod
|
|
@@ -110,9 +110,6 @@ class VortexPayloadProtocol(Protocol, metaclass=ABCMeta):
|
|
|
110
110
|
self._logger.exception(reasonFailure.value)
|
|
111
111
|
|
|
112
112
|
def _processData(self):
|
|
113
|
-
if not self._data:
|
|
114
|
-
return
|
|
115
|
-
|
|
116
113
|
def getNextChunkIter():
|
|
117
114
|
try:
|
|
118
115
|
while True:
|
|
@@ -121,13 +118,14 @@ class VortexPayloadProtocol(Protocol, metaclass=ABCMeta):
|
|
|
121
118
|
# There is no '.' in it, wait for more data.
|
|
122
119
|
return
|
|
123
120
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
if self._data:
|
|
122
|
+
for nextChunk in getNextChunkIter():
|
|
123
|
+
vortexMsg = self._data[:nextChunk]
|
|
124
|
+
self._data = self._data[nextChunk + 1 :]
|
|
127
125
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
# If we get two heartbeats in a row, this will be false
|
|
127
|
+
if len(vortexMsg):
|
|
128
|
+
self._vortexMsgsQueue.append(vortexMsg)
|
|
131
129
|
|
|
132
130
|
if self._vortexMsgsQueue and not self._processVortexMsgs.running:
|
|
133
131
|
reactor.callLater(0, self._processVortexMsgs)
|
|
@@ -172,10 +170,9 @@ class VortexPayloadProtocol(Protocol, metaclass=ABCMeta):
|
|
|
172
170
|
name=self._serverVortexName, uuid=self._serverVortexUuid
|
|
173
171
|
)
|
|
174
172
|
|
|
175
|
-
def _deliverPayload(self,
|
|
176
|
-
|
|
173
|
+
def _deliverPayload(self, payloadEnvelope):
|
|
177
174
|
PayloadIO().process(
|
|
178
|
-
|
|
175
|
+
payloadEnvelope,
|
|
179
176
|
vortexUuid=self._serverVortexUuid,
|
|
180
177
|
vortexName=self._serverVortexName,
|
|
181
178
|
httpSession=None,
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Website : http://www.synerty.com
|
|
7
7
|
* Support : support@synerty.com
|
|
8
8
|
"""
|
|
9
|
+
|
|
9
10
|
import logging
|
|
10
11
|
import uuid
|
|
11
12
|
from typing import Any
|
|
@@ -314,9 +315,10 @@ class VortexServer(VortexABC):
|
|
|
314
315
|
if self.requiresBase64Encoding:
|
|
315
316
|
for index, vortexMsg in enumerate(vortexMsgs):
|
|
316
317
|
if vortexMsg.startswith(b"{"):
|
|
317
|
-
|
|
318
|
+
vortexMsg = yield PayloadEnvelope.base64EncodeDefer(
|
|
318
319
|
vortexMsg
|
|
319
320
|
)
|
|
321
|
+
vortexMsgs[index] = vortexMsg + b"."
|
|
320
322
|
|
|
321
323
|
if vortexUuid is None:
|
|
322
324
|
conns = self._connectionByVortexUuid.values()
|
|
@@ -6,11 +6,14 @@
|
|
|
6
6
|
* Website : http://www.synerty.com
|
|
7
7
|
* Support : support@synerty.com
|
|
8
8
|
"""
|
|
9
|
+
|
|
9
10
|
import logging
|
|
11
|
+
from collections import deque
|
|
10
12
|
from random import random
|
|
11
13
|
from urllib.parse import parse_qs
|
|
12
14
|
from urllib.parse import urlparse
|
|
13
15
|
|
|
16
|
+
from twisted.internet import reactor
|
|
14
17
|
from twisted.internet.defer import inlineCallbacks
|
|
15
18
|
from twisted.internet.protocol import Factory
|
|
16
19
|
from twisted.internet.protocol import Protocol
|
|
@@ -20,7 +23,7 @@ from twisted.web import resource
|
|
|
20
23
|
from twisted.web.server import NOT_DONE_YET
|
|
21
24
|
|
|
22
25
|
from txwebsocket.txws import WebSocketProtocol
|
|
23
|
-
from vortex.DeferUtil import vortexLogFailure
|
|
26
|
+
from vortex.DeferUtil import vortexLogFailure, nonConcurrentMethod
|
|
24
27
|
from vortex.PayloadEnvelope import PayloadEnvelope
|
|
25
28
|
from vortex.VortexServerConnection import VortexServerConnection
|
|
26
29
|
from .PayloadPriority import DEFAULT_PRIORITY
|
|
@@ -31,12 +34,12 @@ logger = logging.getLogger(name=__name__)
|
|
|
31
34
|
|
|
32
35
|
|
|
33
36
|
class VortexWebsocketServerProtocol(Protocol):
|
|
34
|
-
|
|
35
37
|
_DEBUG_LOGGING = False
|
|
36
38
|
|
|
37
39
|
def __init__(self, vortex: VortexServer, addr, httpSession=None) -> None:
|
|
38
40
|
self._vortex = vortex
|
|
39
41
|
self._addr = addr
|
|
42
|
+
self._logger = logger
|
|
40
43
|
|
|
41
44
|
self._conn = None
|
|
42
45
|
|
|
@@ -53,7 +56,9 @@ class VortexWebsocketServerProtocol(Protocol):
|
|
|
53
56
|
|
|
54
57
|
# Most messages don't need a buffer, but websockets can split messages
|
|
55
58
|
# around the 128kb mark
|
|
56
|
-
self.
|
|
59
|
+
self._data = b""
|
|
60
|
+
|
|
61
|
+
self._vortexMsgsQueue = deque()
|
|
57
62
|
|
|
58
63
|
def __initConnection(self):
|
|
59
64
|
# self.transport.setBinaryMode(True)
|
|
@@ -106,28 +111,74 @@ class VortexWebsocketServerProtocol(Protocol):
|
|
|
106
111
|
if self._httpSession:
|
|
107
112
|
self._httpSession.touch()
|
|
108
113
|
|
|
109
|
-
|
|
110
|
-
self._conn.beatReceived()
|
|
111
|
-
return
|
|
114
|
+
self._conn.beatReceived()
|
|
112
115
|
|
|
113
|
-
if
|
|
114
|
-
data
|
|
116
|
+
if data.startswith(b"{"):
|
|
117
|
+
# If the data starts with a { then the payloadEnvelope is al in
|
|
118
|
+
# the websocket message.
|
|
119
|
+
assert data.endswith(b"}"), (
|
|
120
|
+
"%s payloadEnvelope doesn't fit in websocket message" % __name__
|
|
121
|
+
)
|
|
122
|
+
self._vortexMsgsQueue.append(data)
|
|
123
|
+
else:
|
|
124
|
+
# Else it's a base64 encoded payloadEnvelope, and it will be separated
|
|
125
|
+
# by b'.'
|
|
126
|
+
self._data += data
|
|
115
127
|
|
|
116
|
-
|
|
117
|
-
d.addErrback(vortexLogFailure, logger, consumeError=True)
|
|
128
|
+
self._processData()
|
|
118
129
|
|
|
119
130
|
def connectionLost(self, reason=connectionDone):
|
|
120
131
|
if self._DEBUG_LOGGING:
|
|
121
132
|
logger.debug(
|
|
122
133
|
"VortexWebsocketServerProtocol.connectionLost reason=%s", reason
|
|
123
134
|
)
|
|
135
|
+
self._processData()
|
|
124
136
|
if self._conn:
|
|
125
137
|
self._conn.transportClosed()
|
|
126
138
|
self._vortex.connectionClosed(self._conn)
|
|
127
139
|
|
|
140
|
+
def _processData(self):
|
|
141
|
+
def getNextChunkIter():
|
|
142
|
+
try:
|
|
143
|
+
while True:
|
|
144
|
+
yield self._data.index(b".")
|
|
145
|
+
|
|
146
|
+
except ValueError:
|
|
147
|
+
# There is no '.' in it, wait for more data.
|
|
148
|
+
return
|
|
149
|
+
|
|
150
|
+
if self._data:
|
|
151
|
+
for nextChunk in getNextChunkIter():
|
|
152
|
+
vortexMsg = self._data[:nextChunk]
|
|
153
|
+
self._data = self._data[nextChunk + 1 :]
|
|
154
|
+
|
|
155
|
+
# If we get two heartbeats in a row, this will be false
|
|
156
|
+
if len(vortexMsg):
|
|
157
|
+
self._vortexMsgsQueue.append(vortexMsg)
|
|
158
|
+
|
|
159
|
+
if self._vortexMsgsQueue and not self._processVortexMsgs.running:
|
|
160
|
+
reactor.callLater(0, self._processVortexMsgs)
|
|
161
|
+
|
|
128
162
|
@inlineCallbacks
|
|
129
|
-
|
|
130
|
-
|
|
163
|
+
@nonConcurrentMethod
|
|
164
|
+
def _processVortexMsgs(self):
|
|
165
|
+
while self._vortexMsgsQueue:
|
|
166
|
+
vortexMsg = self._vortexMsgsQueue.popleft()
|
|
167
|
+
|
|
168
|
+
try:
|
|
169
|
+
payloadEnvelope = yield PayloadEnvelope().fromVortexMsgDefer(
|
|
170
|
+
vortexMsg
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
self._deliverPayload(payloadEnvelope)
|
|
174
|
+
|
|
175
|
+
except Exception as e:
|
|
176
|
+
print(vortexMsg)
|
|
177
|
+
print(e)
|
|
178
|
+
self._logger.exception(e)
|
|
179
|
+
raise
|
|
180
|
+
|
|
181
|
+
def _deliverPayload(self, payloadEnvelope):
|
|
131
182
|
self._vortex.payloadReveived(
|
|
132
183
|
httpSession=self._httpSession,
|
|
133
184
|
vortexUuid=self._remoteVortexUuid,
|
|
@@ -188,7 +239,6 @@ class VortexWebSocketUpgradeResource(resource.Resource):
|
|
|
188
239
|
self._websocketFactory = websocketFactory
|
|
189
240
|
|
|
190
241
|
def render(self, request):
|
|
191
|
-
|
|
192
242
|
from vortex.VortexFactory import VortexFactory
|
|
193
243
|
|
|
194
244
|
if not VortexFactory.canConnect(str(request.client.host)):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|