Erlang (programming language)/Tutorials/otp design: Difference between revisions
Jump to navigation
Jump to search
imported>Eric Evers No edit summary |
imported>Eric Evers No edit summary |
||
Line 1: | Line 1: | ||
===Fail early and often=== | |||
Fail early and often is a strange and unusual programming method used in OTP. | |||
Processes are programed to a specification about how to handle good input. If | |||
bad input is seen by a worker process we let the process crash. | |||
The supervisor restarts the process and the bad input is ignored. | |||
Fail early and often works well with any type of data flow situation | |||
when a program is processing a flow of messages. | |||
Logically, security and stability is increased by limiting | |||
the propagation of errors to other processes. | |||
Revision as of 11:15, 22 July 2009
Fail early and often
Fail early and often is a strange and unusual programming method used in OTP. Processes are programed to a specification about how to handle good input. If bad input is seen by a worker process we let the process crash. The supervisor restarts the process and the bad input is ignored. Fail early and often works well with any type of data flow situation when a program is processing a flow of messages. Logically, security and stability is increased by limiting the propagation of errors to other processes.