dsmq 1.4.0__py3-none-any.whl → 1.4.1__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/demo.py CHANGED
@@ -2,7 +2,11 @@ import multiprocessing as mp
2
2
 
3
3
  # spawn is the default method on macOS,
4
4
  # starting in Python 3.14 it will be the default in Linux too.
5
- mp.set_start_method("spawn")
5
+ try:
6
+ mp.set_start_method("spawn")
7
+ except RuntimeError:
8
+ # Will throw an error if the start method has alraedy been set.
9
+ pass
6
10
 
7
11
  from dsmq.server import serve # noqa: E402
8
12
  import dsmq.example_get_client # noqa: E402
dsmq/server.py CHANGED
@@ -13,6 +13,8 @@ _max_queue_length = 10
13
13
  _shutdown_pause = 1.0 # seconds
14
14
  _time_between_cleanup = 3.0 # seconds
15
15
  _time_to_keep = 0.3 # seconds
16
+ # _time_between_cleanup = 60.0 # seconds
17
+ # _time_to_keep = 10.0 # seconds
16
18
 
17
19
  # Make this global so it's easy to share
18
20
  dsmq_server = None
@@ -43,13 +45,14 @@ def serve(
43
45
  # These also make it more susceptible to corruption during shutdown,
44
46
  # but since dsmq is meant to be ephemeral, that's not a concern.
45
47
  # See https://www.sqlite.org/pragma.html
48
+ # After playing around with them, I'm not sure these have any noticeable effect.
46
49
  #
47
- cursor.execute("PRAGMA journal_mode = OFF")
50
+ # cursor.execute("PRAGMA journal_mode = OFF")
48
51
  # cursor.execute("PRAGMA journal_mode = MEMORY")
49
52
  # cursor.execute("PRAGMA synchronous = NORMAL")
50
- cursor.execute("PRAGMA synchronous = OFF")
51
- cursor.execute("PRAGMA secure_delete = OFF")
52
- cursor.execute("PRAGMA temp_store = MEMORY")
53
+ # cursor.execute("PRAGMA synchronous = OFF")
54
+ # cursor.execute("PRAGMA secure_delete = OFF")
55
+ # cursor.execute("PRAGMA temp_store = MEMORY")
53
56
 
54
57
  cursor.execute("""
55
58
  CREATE TABLE IF NOT EXISTS messages (timestamp DOUBLE, topic TEXT, message TEXT)
@@ -4,9 +4,8 @@ import multiprocessing as mp
4
4
  # starting in Python 3.14 it will be the default in Linux too.
5
5
  try:
6
6
  mp.set_start_method("spawn")
7
- except RuntimeError as e:
8
- print(e)
9
- print(f"Using multiprocessing start method: {mp.get_start_method()}")
7
+ except RuntimeError:
8
+ pass
10
9
 
11
10
  import time
12
11
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dsmq
3
- Version: 1.4.0
3
+ Version: 1.4.1
4
4
  Summary: A dead simple message queue
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.10
@@ -102,7 +102,8 @@ a queue before it connected.
102
102
  - A client will get the oldest message available on a requested topic.
103
103
  Queues are first-in-first-out.
104
104
 
105
- - Messages older than 600 seconds will be deleted from the queue.
105
+ - Messages older than a certain age (typically 600 seconds)
106
+ will be deleted from the queue.
106
107
 
107
108
  - Put and get operations are fairly quick--less than 100 $`\mu`$s of processing
108
109
  time plus any network latency--so it can comfortably handle requests at rates of
@@ -0,0 +1,13 @@
1
+ dsmq/__init__.py,sha256=YCgbnQAk8YbtHRyMcU0v2O7RdRhPhlT-vS_q40a7Q6g,50
2
+ dsmq/client.py,sha256=a4_6jcF7RAC58And0OlR3vL42FgZ24q2BECS-VF4Ri4,3438
3
+ dsmq/demo.py,sha256=HCnoucawZ2CU0rGipLgsZjVUpP7232mUcugmhf_DjBQ,825
4
+ dsmq/example_get_client.py,sha256=PvAsDGEAH1kVBifLVg2rx8ZxnAZmvzVCvZq13VgpLds,301
5
+ dsmq/example_put_client.py,sha256=QxDc3i7KAjjhpwxRRpI0Ke5KTNSPuBf9kkcGyTvUEaw,353
6
+ dsmq/server.py,sha256=PbmbW95VunRrQM24AdzX9HbqWPixt7XrAINV1yiHpxo,10210
7
+ dsmq/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ dsmq/tests/integration_test.py,sha256=zF6v_3UHt5KqveX22gEpCSLcoeOyEWLSy_gMLoytg2U,6303
9
+ dsmq/tests/performance_suite.py,sha256=g95jm0u2sa-1hm6m10aoRgN7_tynXFxU-bimy3V2wZM,5391
10
+ dsmq-1.4.1.dist-info/METADATA,sha256=LuoL1eb8_zH2bDCY7QRlKrZ3ndK0UJ1gXJKZ-4miWYc,5229
11
+ dsmq-1.4.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
+ dsmq-1.4.1.dist-info/licenses/LICENSE,sha256=3Yu1mAp5VsKmnDtzkiOY7BdmrLeNwwZ3t6iWaLnlL0Y,1071
13
+ dsmq-1.4.1.dist-info/RECORD,,
dsmq/.client.py.swp DELETED
Binary file
dsmq/.server.py.swp DELETED
Binary file
@@ -1,15 +0,0 @@
1
- dsmq/.client.py.swp,sha256=bm5ybp3ESthgsOMpHRygMeQWbSlK4xw8toIKiT5A0pM,12288
2
- dsmq/.server.py.swp,sha256=R61qwjXxZUZAbNpEXSW_jvxkXvy4qqt7gA1FEzwE-jk,20480
3
- dsmq/__init__.py,sha256=YCgbnQAk8YbtHRyMcU0v2O7RdRhPhlT-vS_q40a7Q6g,50
4
- dsmq/client.py,sha256=a4_6jcF7RAC58And0OlR3vL42FgZ24q2BECS-VF4Ri4,3438
5
- dsmq/demo.py,sha256=x2ueymZnSQNtQ-HjzRiSCa0rg4NOm0YUIaj5VPXfnD8,718
6
- dsmq/example_get_client.py,sha256=PvAsDGEAH1kVBifLVg2rx8ZxnAZmvzVCvZq13VgpLds,301
7
- dsmq/example_put_client.py,sha256=QxDc3i7KAjjhpwxRRpI0Ke5KTNSPuBf9kkcGyTvUEaw,353
8
- dsmq/server.py,sha256=yANPboqqoAw7GnSyHs_SeYlZjKkQPDMIhRo7tGDw6zo,10041
9
- dsmq/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- dsmq/tests/integration_test.py,sha256=zF6v_3UHt5KqveX22gEpCSLcoeOyEWLSy_gMLoytg2U,6303
11
- dsmq/tests/performance_suite.py,sha256=LgNpqD0zumEOgrNDLkeirBmQAALhlxEH7bXe4z-EuIY,5474
12
- dsmq-1.4.0.dist-info/METADATA,sha256=RTvtHRtUg4HSOvyMRTu7sFy3uu3Ddd7iOXD1IWK91QQ,5203
13
- dsmq-1.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
- dsmq-1.4.0.dist-info/licenses/LICENSE,sha256=3Yu1mAp5VsKmnDtzkiOY7BdmrLeNwwZ3t6iWaLnlL0Y,1071
15
- dsmq-1.4.0.dist-info/RECORD,,
File without changes