Put the host-implemented seams on Task, keep ValueTask inside the validation pipeline - #336
Merged
Merged
Conversation
…de the pipeline The dividing line is who implements the contract and what production does there. IStreamStore, IEventOutbox, IJtiReplayCache, ISecurityEventSink, IEventSharingPolicy and SigningKeySource are seams a host implements, and the production implementations our own architecture picked for them - the Redis outbox, the distributed replay cache, a database-backed sink - always perform real I/O, where ValueTask saves nothing and its single-await restriction only taxes implementors; Task is the natural contract there, and the true/false results the sync implementations return ride the runtime's cached Task singletons for free. ISecurityEventTokenValidator stays on ValueTask deliberately: its steps are this package's own implementations, nine of ten complete synchronously on every deployment, and the composite awaits each exactly once - the textbook case the type exists for. The change also removes the friction the old shape produced: the configuration store's constructor loses its AsTask bridge, and the Redis concurrency test feeds Task.WhenAll directly instead of through wrapper functions.
|
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.



The dividing line is who implements the contract and what production does there. IStreamStore, IEventOutbox, IJtiReplayCache, ISecurityEventSink, IEventSharingPolicy and SigningKeySource are host-implemented seams whose production implementations - the Redis outbox, the distributed replay cache, database-backed sinks - always perform real I/O: ValueTask saves nothing there while its single-await restriction taxes implementors, and the sync implementations' boolean results ride the runtime's cached Task singletons for free. ISecurityEventTokenValidator deliberately stays on ValueTask: its steps are this package's own implementations, nine of ten complete synchronously on every deployment, and the composite awaits each exactly once. The old shape's friction disappears with it: the configuration store's constructor loses its AsTask bridge, and the Redis concurrency test feeds Task.WhenAll directly instead of through wrapper functions.