6
0
mirror of https://git.mills.io/prologic/msgbus.git synced 2024-06-30 18:51:44 +00:00
Commit Graph

10 Commits

Author SHA1 Message Date
James Mills
01ab56f9b3 Fix Subscribe() deadlock (#34)
Fixes #139

This was caused by full subscriber buffers.

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/prologic/msgbus/pulls/34
2022-04-04 01:15:49 +00:00
James Mills
6bfb669347 Add support for a write-ahead-log (WAL) to persist messages (#33)
Closes #31

Adds support for a write-ahead-log (WAL) for messages per queue/topic. This is now the new default behaviour and adds a new CLI flag `-l/--log-path` and Env var `LOG_PATH` to configure where the logs are stored.

On startup, the message bus will refill the queues with the contents of messages from persisted log files with the most recent `-Q/--max-queue-size` number of items.

That is, on startup/crash the queues/topics will always contain the same messages as if the message bus had never restarted or crashed in the first place.

This has a benefit of actually making the per-topic sequence number _actually_ monotic increasing integers and something that can be relied upon when indexing into a queue/topic for subscribers with the `-i/--index` / `Index` option.

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/prologic/msgbus/pulls/33
2022-04-03 15:59:38 +00:00
James Mills
06a193b0cc
Fix some data races 2022-03-21 00:29:02 +10:00
James Mills
129efabcc3
Fix import paths 2021-07-13 07:57:54 +10:00
James Mills
c39cfce477
Fixe two other missed references to NewMessageBus from 22efa3a 2018-05-08 01:58:37 -07:00
James Mills
3dbba632c7
Fixed tests 2018-05-02 01:24:30 -07:00
James Mills
f20b6cd8b9
Added basic metrics 2018-05-02 00:41:14 -07:00
James Mills
7402386c08
Fixed some bugs in sample code 2018-04-30 23:07:27 -07:00
James Mills
dc7243ffa9
Per topic sequences with ttl 2017-08-14 00:34:12 -07:00
James Mills
caad5af2c1
Updated README with library usage example 2017-08-09 03:04:02 -07:00