Tripwire

Hex.pm

Tripwire wraps GenServer calls with a circuit breaker, fast-failing requests when a dependency is unhealthy and automatically probing for recovery.

Installation

def deps do
[
{:tripwire, "~> 0.1.0"}
]
end

Quick start

# In your Application.start/2:
children = [
{Registry, keys: :unique, name: Tripwire.Breaker.registry()},
{Task.Supervisor, name: Tripwire.TaskSupervisor},
{MyApp.Weather, [name: MyApp.Weather]},
{Tripwire, target_key: :weather, target_pid: MyApp.Weather}
]
# Call through the breaker:
{:ok, :sunny} = Tripwire.call(:weather, :forecast)
{:error, :circuit_open} = Tripwire.call(:weather, :forecast) # after failures

Modules

Documentation

Development

This section explains how to setup the project locally for development.

Dependencies

Get the Source

Clone the project locally:

# via HTTPS
git clone https://github.com/nrednav/tripwire.git
# via SSH
git clone git@github.com:nrednav/tripwire.git

Install

Install the project's dependencies:

cd tripwire/
mix deps.get

Test

Run the test suite:

mix test

Versioning

This project uses Semantic Versioning. For a list of available versions, see the repository tag list.

Issues & Requests

If you encounter a bug or have a feature request, please open an issue on the GitHub repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.