Skip to content

chassisframework/arq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARQ

Dead simple Automatic Request Repeat implementation for independent messages.

Local party sends messages by providing an mfa or a fun/0 to ARQ.start/2.

Upon receipt of message, remote party can acknowledge the message (and stop its repeat) by calling ARQ.stop/1 or sending :stop to the requestor process.

Example:

{:ok, supervisor} = ARQ.start_link()

receiver =
  spawn(fn ->
    receive do
      {sender, msg} ->
        IO.puts "Received #{inspect msg} from #{inspect sender}, telling it to stop."
        ARQ.stop(sender)
    end
  end)

ARQ.start(fn -> send(receiver, {self(), :hi}) end, supervisor)

Installation

If available in Hex, the package can be installed by adding arq to your list of dependencies in mix.exs:

def deps do
  [
    {:arq, "~> 0.3.1"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/arq.

About

Simple Automatic Repeat Request (ARQ) for Elixir

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages