Skip to content
/ exsozu Public

A resilient Elixir client for the Sōzu HTTP reverse proxy.

License

Notifications You must be signed in to change notification settings

evuez/exsozu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExSozu

CircleCI

A resilient Elixir client for the Sōzu HTTP reverse proxy.

Answers are sent to the calling process via Process.send/3 and should be handled in a handle_info/2 or using receive/1 (the messages are in this format: {:answer, %ExSozu.Answer{}}).

The documentation is available at https://hexdocs.pm/exsozu.

Installation

Add exsozu to your list of dependencies in mix.exs:

def deps do
  [{:exsozu, "~> 0.4.0"}]
end

Examples

iex> ExSozu.Command.list_workers() |> ExSozu.command()
iex> receive do: (m -> m)
{:answer,
 %ExSozu.Answer{data: %{"data" => [%{"id" => 0, "pid" => 9,
   "run_state" => "RUNNING"}], "type" => "WORKERS"}, id: "oA7iu2qVAL2JNkBg",
 message: "", status: :ok}}

Or, using ExSozu.pipeline/1 to send multiple commands at once:

iex> [ExSozu.Command.list_workers(), ExSozu.Command.status()] |> ExSozu.pipeline()
iex> receive do: (m -> m)
{:answer,
 %ExSozu.Answer{data: %{"data" => [%{"id" => 0, "pid" => 9,
   "run_state" => "RUNNING"}], "type" => "WORKERS"}, id: "...",
 message: "", status: :ok}}
iex> receive do: (m -> m)
{:answer,
 %ExSozu.Answer{data: nil,
   id: "...",
   message: "", status: :ok}}

I also made a demo interface using ExSozu: https://github.com/evuez/sozui.

About

A resilient Elixir client for the Sōzu HTTP reverse proxy.

Resources

License

Stars

Watchers

Forks

Packages

No packages published