A simple OTP Application (and eventually an HTTP API) which enables short circuiting when a service becomes unavailable.
Used as a learning project for members of Belfast Elixir.
- Build:
mix do deps.get, compile - Test:
mix test - Documentation:
mix docs - REPL:
iex -S mix - Observe:
:observer.start
# Ping will register service with that id as alive
id = "my-svc-id"
DMS.ping(id) # => :pong
DMS.alive?(id) # => true ~ Service with id responds as alive
# After @timeout period and no further pings
DMS.alive?(id) # => false ~ Service with id responds as dead# An id which has never pinged will also respond as dead
false = DMS.alive?("another-svc-id") #=> false- (#13) Model a Service as a Process (
DMS.Service) - (#1) Register Service against an
id(DMS.Servce.Registry) - (#2) Add a supervisor for Service Process (
DMS.Service.Supervisor) - (#3) Add
ping(id)function which will init Service if doesn't exist - (#4) Add
alive?(id)function which returnstrueif service alive otherwisefalse - (#5) Add timer to service process which will terminate the process if it hasn't been pinged within
@timeout - (#12) Add Documentation with ExDoc
- (#6) Add Credo & Dialyzer for linting and static analysis.
- (#7) Add API to set service as down (before timeout).
- (#8) Enhance
DMS.idto contain service id and account token + hash it before use as key inDMS.Servise.Registry. - (#9) Add HTTP API.
- (#10) Add Pub/Sub push based API to notify when service is down.
- (#11) Publish on HEX package manager.