|
|
|
|
|
by ArnoVW
1822 days ago
|
|
Idempotecy means you can run something several times and it will do the same thing. Let's say you're controlling a factory and you have a function that fills a reservoir. A naive way would be to define the semantics of the operation as "send enough liquid" and open the circuit for 10 minutes when activated. Since it takes 10 min to fill, all is good. But what if your program crashes and you have to rerun. If the reservoir was already semi-filled, you will overflow it. If the semantics of the operation is "send liquid until 'full' sensor indicates you're done", that's liberating. You no longer have to worry about overflowing the reservoir. |
|