-
-
Notifications
You must be signed in to change notification settings - Fork 146
Comments
Draft
Conversation
Benchmark ResultsComparison of Open to see the benchmark results
Generated by phpbench against commit 2caea11 |
@xHeaven
xHeaven
force-pushed
the
idempotency
branch
from
February 20, 2026 03:05
d750f77 to
fd2a050
Compare
@xHeaven
xHeaven
force-pushed
the
idempotency
branch
from
February 20, 2026 04:07
fd2a050 to
a622973
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Overview
This PR adds idempotency support for HTTP routes and command bus commands. It prevents duplicate side effects by storing the result of the first execution and replaying it for subsequent requests with the same idempotency key.
Payment processing, order creation, resource provisioning and any operation where retrying the same request should not produce duplicate side effects. Timeouts, retries by clients, and accidental double clicks all cause the same problem: the server can't distinguish a retry from a new request.
Routes
Add
#[Idempotent]to a controller method. Clients send anIdempotency-Keyheader. The first request executes normally and caches the response. Subsequent requests with the same key replay the cached response.Example:
Commands
Mark a command with
#[IdempotentCommand]. Duplicate dispatches with the same payload are silently skipped.Example:
Commands can also provide explicit keys via
HasIdempotencyKey.Example:
Known limitations at the opening of PR
(削除) No differentiation between in-progress/same key, different payload cases (削除ここまで)(削除) Scoping is weak, we need an additional component (user-provided resolver) (削除ここまで)(削除) Heartbeat renewal is not implemented yet (削除ここまで)(削除) We need to target onlyPOSTandPATCHmethods, disallow others (削除ここまで)Wonftixes (design decision)
posixandpcntlusage