Point-to-point, durable message-queues as GenStage producers.
Stagger enables the creation of GenStage processes that enqueue terms to simple, file-backed message-queues, allowing the producer and consumer to run independently of each other, possibly at different times.
+----------+ +----------+ +----------+ +------------+
| Upstream | | MsgQueue | | MsgQueue | | Downstream |
| | -> | | <- | | <---> | |
| Client | | Producer | | Consumer | | Processing |
+----------+ +----------+ +----------+ +------------+
| | read
write | |
+------+
| FILE |
| |
| |
+------+
Your upstream client writes its events into the message-queue (provided by Stagger), which persists them to local storage. Your (GenStage) consumer, subscribes to the producer and receives events, via this local storage.
The package can be installed by adding stagger
to your list of dependencies in mix.exs
:
def deps do
[
{:stagger, "~> 0.1.7"}
]
end
The docs can be found at https://hexdocs.pm/stagger.
Copyright (c) 2022, Nick Gunn
Stagger runtime source code is licensed under the MIT License. Stagger test source code is licensed under the GPL3 License.