Skip to content

Put the host-implemented seams on Task, keep ValueTask inside the validation pipeline - #336

Merged
kirill-abblix merged 1 commit into
developfrom
refactor/host-seams-on-task
Aug 4, 2026
Merged

Put the host-implemented seams on Task, keep ValueTask inside the validation pipeline#336
kirill-abblix merged 1 commit into
developfrom
refactor/host-seams-on-task

Conversation

@kirill-abblix

Copy link
Copy Markdown
Member

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.

…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.
@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@kirill-abblix
kirill-abblix merged commit 7353407 into develop Aug 4, 2026
22 checks passed
@kirill-abblix
kirill-abblix deleted the refactor/host-seams-on-task branch August 4, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant