dsmq 1.2.1__py3-none-any.whl → 1.2.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dsmq/client.py
CHANGED
@@ -9,14 +9,16 @@ _n_retries = 10
|
|
9
9
|
_initial_retry = 0.01 # seconds
|
10
10
|
|
11
11
|
|
12
|
-
def connect(host=_default_host, port=_default_port):
|
13
|
-
return DSMQClientSideConnection(host, port)
|
12
|
+
def connect(host=_default_host, port=_default_port, verbose=False):
|
13
|
+
return DSMQClientSideConnection(host, port, verbose=verbose)
|
14
14
|
|
15
15
|
|
16
16
|
class DSMQClientSideConnection:
|
17
|
-
def __init__(self, host, port):
|
17
|
+
def __init__(self, host, port, verbose=False):
|
18
18
|
self.uri = f"ws://{host}:{port}"
|
19
|
-
|
19
|
+
self.verbose = verbose
|
20
|
+
if self.verbose:
|
21
|
+
print(f"Connecting to dsmq server at {self.uri}")
|
20
22
|
for i_retry in range(_n_retries):
|
21
23
|
try:
|
22
24
|
self.websocket = ws_connect(self.uri)
|
@@ -26,7 +28,8 @@ class DSMQClientSideConnection:
|
|
26
28
|
# Exponential backoff
|
27
29
|
# Wait twice as long each time before trying again.
|
28
30
|
time.sleep(_initial_retry * 2**i_retry)
|
29
|
-
|
31
|
+
if self.verbose:
|
32
|
+
print(" ...trying again")
|
30
33
|
|
31
34
|
if self.websocket is None:
|
32
35
|
raise ConnectionRefusedError("Could not connect to dsmq server.")
|
@@ -1,12 +1,12 @@
|
|
1
1
|
dsmq/__init__.py,sha256=YCgbnQAk8YbtHRyMcU0v2O7RdRhPhlT-vS_q40a7Q6g,50
|
2
|
-
dsmq/client.py,sha256=
|
2
|
+
dsmq/client.py,sha256=1fQLRExDkdLogu8M5aofkYp3-Qy5a2y3aMYy7qC3NkE,2214
|
3
3
|
dsmq/demo.py,sha256=K53cC5kN7K4kNJlPq7c5OTIMHRCKTo9hYX2aIos57rU,542
|
4
4
|
dsmq/example_get_client.py,sha256=PvAsDGEAH1kVBifLVg2rx8ZxnAZmvzVCvZq13VgpLds,301
|
5
5
|
dsmq/example_put_client.py,sha256=QxDc3i7KAjjhpwxRRpI0Ke5KTNSPuBf9kkcGyTvUEaw,353
|
6
6
|
dsmq/server.py,sha256=kCqBzgikvJlCgAfLHd18LS7fmkYW6e0RhmdwqdeXJ7Q,6079
|
7
7
|
dsmq/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
dsmq/tests/integration_test.py,sha256=lC97LAzdQixv75OwjqjKTvYnSZpsP0zuzFP8ocUnjl8,6031
|
9
|
-
dsmq-1.2.
|
10
|
-
dsmq-1.2.
|
11
|
-
dsmq-1.2.
|
12
|
-
dsmq-1.2.
|
9
|
+
dsmq-1.2.2.dist-info/METADATA,sha256=1n3_ZM8haJ5U99_fx6vZWpVYzfSR1RLUn_Ich87HaBo,4730
|
10
|
+
dsmq-1.2.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
11
|
+
dsmq-1.2.2.dist-info/licenses/LICENSE,sha256=3Yu1mAp5VsKmnDtzkiOY7BdmrLeNwwZ3t6iWaLnlL0Y,1071
|
12
|
+
dsmq-1.2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|