WSGI idempotency middleware (most options are ASGI-only) #6121
Unanswered
violetta98
asked this question in
Q&A
Replies: 2 comments 2 replies
|
Reads like Claude code…? |
1 reply
|
i'm horrified - that lib messes up vocabulary so bad it needs to be breached off ensuring exactly once semantics for specific state transition is NOT idempotent - its a precise opposite to weave the word idempotent into that is a disservice for anyone learning - i'm appalled what people need for details like charging a order exactly once are structural patterns that ensure transaction conflicts will naturally prevent more than once actions, not a library that slaps the wrong terminology on the wrong place and teaches fire and forget |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone!
I got tired of rewriting idempotency in every service and getting it slightly wrong, so I packaged it. Posting here because most Python options are ASGI-only, which leaves Flask out.
A client retrying a POST with the same
Idempotency-Keygets the first response back and your view doesn't run again. Two identical requests at the same moment: one runs, the other waits for its result instead of erroring.One honest caveat, because I'd rather say it than have someone find out. The sync path runs on top of an async core through a background event loop. Correct and fine at typical Flask loads, but it's a bridge, not a native sync implementation.
https://github.com/idemkit/idemkit, Apache-2.0
I would appreciate any feedback on it and whether it might be useful for you.
All reactions