Recipes
Resolve Input conflicts
Enqueue, replace, or reject related Commands before they enter processing.
v0.1.0-dev.2Intermediateusecase_forge
Open source reference ↗Resolve Input conflicts
UseCaseInputConflictPolicy compares related Entries still in AdmissionQueue or PendingQueue. It does not inspect active Executions.
| Policy | Effect |
|---|---|
enqueue | keeps every related Entry; this is the default |
replace | removes all related waiting Entries and admits the new one |
rejectNew | preserves waiting Entries and rejects the new one |
dart
registerCommand<SaveDraft>(
_save,
instructions: const UseCaseInstructionOverrides(
input: UseCaseInputInstructionOverrides(
conflictPolicy: UseCaseInputConflictPolicy.replace,
),
),
);
replace and rejectNew require executionKey; enqueue does not. Replaced Entries are reported as replaced, while rejected new Entries use inputConflict. Neither kind becomes history because processing never started.
Choose replace for obsolete queued intent, rejectNew when the first waiting intent owns the slot, and enqueue when every accepted intent remains meaningful.