haskell-distributed / distributed-process-platform

DEPRECATED (Cloud Haskell Platform) in favor of distributed-process-extras, distributed-process-async, distributed-process-client-server, distributed-process-registry, distributed-process-supervisor, distributed-process-task and distributed-process-execution
http://haskell-distributed.github.com
BSD 3-Clause "New" or "Revised" License
47 stars 18 forks source link

[DPP-106] Supervision enhancements #99

Open qnikst opened 9 years ago

qnikst commented 9 years ago

[Imported from JIRA. Reported by Tim Watson [Administrator] @hyperthunk) as DPP-106 on 2014-04-22 11:16:18] Post release goodies... Introduction of a "circuit breaker" pattern of supervision for Service entities.

This comes in two flavours.

  1. an FSM in front of the protected service, which controls service restarts once they fail (based on supervision).
  2. a Circuit Breaker that detects error in underlying sub-systems and avoids making further queries.

API Examples:

{code} case circuit_breaker:call(db, "select * from my_table;") of off -> error_logger:error_msg("database unavailable"); {error, db_unavailable}; {ok, Result} -> Result end {code}

Motivation & differences from Supervisor....

Allows you to {{call}} a service via the middle-man, providing better isolation between subsystems, reducing timeouts and making per sub-system monitoring easier. Dealing with cascading errors.

Relies on Supervisor, is a new API (and possible more than one new supporting service).

All post release...