rfc:ripples
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:ripples [2013/10/30 10:43] – [Proposal] krakjoe | rfc:ripples [2013/10/30 10:47] – [Proposal] krakjoe | ||
---|---|---|---|
Line 60: | Line 60: | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | A //Ripple// will encapsulate or describe conditions on the scale from warning to exception, a //dam// will deal with those conditions and, if no exceptions/ | + | A //Ripple// will encapsulate or describe conditions on the scale from warning to exception, a //dam// will deal with those conditions and, if no exceptions/ |
<code php> | <code php> | ||
Line 67: | Line 67: | ||
try { | try { | ||
$data = $socket-> | $data = $socket-> | ||
- | + | ||
try { | try { | ||
while (($buffer = $socket-> | while (($buffer = $socket-> | ||
Line 84: | Line 84: | ||
} | } | ||
+ | </ | ||
+ | |||
+ | Dropping ripples may look like: | ||
+ | |||
+ | <code php> | ||
+ | /* ... */ | ||
+ | drop new SocketReadRipple($socket); | ||
+ | /* ... */ | ||
</ | </ | ||
The flow of this program could be described as fragmented, but it is *not* broken, execution _flows_ from one block to another in a non-linear way. | The flow of this program could be described as fragmented, but it is *not* broken, execution _flows_ from one block to another in a non-linear way. | ||
+ | |||
+ | Instead of throwing exceptions to be caught, unconditionally altering the flow of execution, we can drop ripples to be dammed allowing execution to recover. | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
rfc/ripples.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1