A Naive FIFO Buffer Queue with SQLite as persistence layer
Bufferlite implements a persistent FIFO buffer on top of sqlitex package.
If available in Hex, the package can be installed as:
- Add
bufferlite
to your list of dependencies inmix.exs
:
```elixir
def deps do
[{:bufferlite, "~> 0.1.0"}]
end
```
- Ensure
bufferlite
is started before your application:
```elixir
def application do
[applications: [:bufferlite]]
end
```
- Use it to buffer any Elixir/Erlang term.
>{:ok, pid} = Bufferlite.start_link("mybuff.db")
>Bufferlite.new_buffer(pid, "buff")
>Bufferlite.push(pid, "buff", {:ok, [1, 2, 3, 4], :some})
>Bufferlite.pop(pid, "buff")
{:ok, [1, 2, 3, 4], :some}
- TODO
- Benchmarks
MIT