3 ms·
Idempotent is not "side effect free", but rather with only side effects that need to be safe to duplicate and deduplicate. As in "increase counter by 1" is not
by afiori 5y ago
Idempotent is not "side effect free", but rather with only side effects that need to be safe to duplicate and deduplicate.
As in "increase counter by 1" is not idempotent, "set counter to 2" and "set counter (monotonic*) counter to 2 if current value is 0" are idempotent.
It is quite weak as a requirement for example an API that functionally must not be cached can still be idempotent.