The persistent message queue on Elixir
git clone [email protected]:Merff/Queue.git queue
cd queue
mix deps.get
- Set db credentials in
dev.exs
andtest.exs
MIX_ENV=test mix ecto.create
MIX_ENV=test mix ecto.migrate
- Now you can run:
mix test
For run in console add:
mix ecto.create
mix ecto.migrate
run iex -S mix
for try API features:
Queue.add("my awesome message")
- for add new message
-> {:ok, "new message added!"}
Queue.get()
- for get next message in queue
-> {:ok, %Queue.Message{ id: 1, status: :processing, text: "my awesome message"} }
Queue.ack(1)
- for set message as ack, message_id as argument
-> {:ok, %Queue.Message{ id: 1, status: :ack,text: "my awesome message"} }
Queue.reject(1)
- for set message as reject, message_id as argument
-> {:ok, %Queue.Message{ id: 1, status: :reject: "my awesome message"} }