dsmq 0.5.0__py3-none-any.whl → 0.6.0__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/dsmq.py
CHANGED
@@ -10,15 +10,12 @@ DEFAULT_PORT = 30008
|
|
10
10
|
|
11
11
|
N_RETRIES = 5
|
12
12
|
FIRST_RETRY = 0.01 # seconds
|
13
|
-
TIME_TO_LIVE =
|
14
|
-
TIME_TO_LIVE = 5 # seconds
|
13
|
+
TIME_TO_LIVE = 600.0 # seconds
|
15
14
|
|
16
15
|
|
17
16
|
def start_server(host=DEFAULT_HOST, port=DEFAULT_PORT):
|
18
17
|
"""
|
19
18
|
For best results, start this running in its own process and walk away.
|
20
|
-
|
21
|
-
|
22
19
|
"""
|
23
20
|
sqlite_conn = sqlite3.connect("file:mem1?mode=memory&cache=shared")
|
24
21
|
cursor = sqlite_conn.cursor()
|
@@ -93,7 +90,6 @@ def _handle_client_connection(socket_conn):
|
|
93
90
|
|
94
91
|
msg_str = data.decode("utf-8")
|
95
92
|
try:
|
96
|
-
# print("dsmq received ", msg_str)
|
97
93
|
msg = json.loads(msg_str)
|
98
94
|
except json.decoder.JSONDecodeError:
|
99
95
|
print("Message must be json-friendly")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: dsmq
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.6.0
|
4
4
|
Summary: A dead simple message queue
|
5
5
|
Requires-Python: >=3.10
|
6
6
|
Description-Content-Type: text/markdown
|
@@ -97,6 +97,8 @@ a queue before it connected.
|
|
97
97
|
- A client will get the oldest message available on a requested topic.
|
98
98
|
Queues are first-in-first-out.
|
99
99
|
|
100
|
+
- Messages older than 600 seconds will be deleted from the queue.
|
101
|
+
|
100
102
|
- Put and get operations are fairly quick--less than 100 $`\mu`$s of processing
|
101
103
|
time plus any network latency--so it can comfortably handle requests at rates of
|
102
104
|
hundreds of times per second. But if you have several clients reading and writing
|
@@ -127,7 +129,7 @@ Connects to an existing message queue server.
|
|
127
129
|
## `DSMQClientSideConnection` class
|
128
130
|
|
129
131
|
This is a convenience wrapper, to make the `get()` and `put()` functions
|
130
|
-
easy to write and remember.
|
132
|
+
easy to write and remember. It's under the hood only, not meant to be called directly.
|
131
133
|
|
132
134
|
### `put(topic, msg)`
|
133
135
|
|
@@ -143,4 +145,4 @@ connected to the server.
|
|
143
145
|
- `topic` (str)
|
144
146
|
- returns str, the content of the message. If there was no eligble message
|
145
147
|
in the topic, or the topic doesn't yet exist,
|
146
|
-
returns ""
|
148
|
+
returns `""`.
|
@@ -1,10 +1,10 @@
|
|
1
1
|
dsmq/__init__.py,sha256=YCgbnQAk8YbtHRyMcU0v2O7RdRhPhlT-vS_q40a7Q6g,50
|
2
2
|
dsmq/demo_linux.py,sha256=7yLglGmirDLuuyMxppYSK-dfx2Fg2Q0dIWB4cl2yV1c,622
|
3
|
-
dsmq/dsmq.py,sha256=
|
3
|
+
dsmq/dsmq.py,sha256=zg69Tf3x9z26a9NrEXTWgr78kcNKVszmLq0INv3IHuM,6132
|
4
4
|
dsmq/example_get_client.py,sha256=chFfB2949PBENmgdUc3ASrATq1m4wvHGBzEnOC-o_Xs,296
|
5
5
|
dsmq/example_put_client.py,sha256=mUKCRhmUieMZEpHLFWFvzeKB6IR7A8l4tWN8TvPzdKU,348
|
6
6
|
dsmq/example_server.py,sha256=kkXOPaaTzVxf9_iIM76zU9pZhkPna_1vcGWkPrhCjus,61
|
7
|
-
dsmq-0.
|
8
|
-
dsmq-0.
|
9
|
-
dsmq-0.
|
10
|
-
dsmq-0.
|
7
|
+
dsmq-0.6.0.dist-info/METADATA,sha256=0mL4N2uHDGtlnH_fqrdNLdpS-flp6x1O1g-uLGzF4b4,4006
|
8
|
+
dsmq-0.6.0.dist-info/WHEEL,sha256=3U_NnUcV_1B1kPkYaPzN-irRckL5VW_lytn0ytO_kRY,87
|
9
|
+
dsmq-0.6.0.dist-info/licenses/LICENSE,sha256=3Yu1mAp5VsKmnDtzkiOY7BdmrLeNwwZ3t6iWaLnlL0Y,1071
|
10
|
+
dsmq-0.6.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|