dsmq 1.2.1__tar.gz → 1.2.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dsmq
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: A dead simple message queue
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.10
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dsmq"
3
- version = "1.2.1"
3
+ version = "1.2.2"
4
4
  description = "A dead simple message queue"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -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
- print(f"Connecting to dsmq server at {self.uri}")
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
- print(" ...trying again")
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.")
@@ -12,7 +12,7 @@ wheels = [
12
12
 
13
13
  [[package]]
14
14
  name = "dsmq"
15
- version = "1.2.0"
15
+ version = "1.2.2"
16
16
  source = { editable = "." }
17
17
  dependencies = [
18
18
  { name = "pytest" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes