A Broadway producer for an in-memory buffer.
The package can be installed by adding off_broadway_memory
to your list of
dependencies in mix.exs
:
def deps do
[
{:off_broadway_memory, "~> 1.1"}
]
end
Usage (full documentation)
Start a buffer:
OffBroadwayMemory.Buffer.start_link(name: :example_buffer)
Connect it to Broadway:
Broadway.start_link(MyBroadway,
name: MyBroadway,
producer: [
module: {OffBroadwayMemory.Producer, buffer: :example_buffer},
concurrency: 1
],
processors: [default: [concurrency: 50]]
)
Push data to be processed:
OffBroadwayMemory.Buffer.push(:example_buffer, ["example", "data", "set"])
OffBroadwayMemory
is released under the Apache License 2.0
.
This package was written by Elliot Jackson.
- Blog: https://elliotekj.com
- Email: elliot@elliotekj.com