4 ms·
> getting it to do a second thing midway before finishing doing the first thing I'm not sure this is the kind of failure idempotency is design to tackle. Idem
by rmbyrro 3y ago
> getting it to do a second thing midway before finishing doing the first thing
I'm not sure this is the kind of failure idempotency is design to tackle.
Idempotency tackles the issue of handling multiple requests for doing the same thing, isn't it?
- weaksauce 3y ago> Idempotency tackles the issue of handling multiple requests for doing the same thing, isn't it? yeah... there should be no extra side effect if you call something more than once on it with the same parameters. ie foo(x) is the same as foo(foo(x)) is the same as foo(foo(foo(x))) or in networking GET x is the same as GET x followed by a GET x etc... the GET request doesn't (*shouldn't) change anything.
- wayfinder 3y agoIt gave me an intuitive understanding of state machines and idempotency is one solution to transitions. If you start with State A and a call changes it to State B, what does running the call again do? A->B? But you’re already at B. Shit’s going to break. Redesign your system.
- rmbyrro 3y agoIn this example, it seems the API should return some 4xx error. If there's a process with two steps, moving from Step A to B requires the process to be at Step A and it's already at step B, it should return an error. At first glance, this doesn't seem the kind of problem that idempotency is supposed to prevent...
- wayfinder 3y agoInstead of idempotency you can return a 4xx error too. You use idempotency because it’s logistically less complicated for the client.