usecase_forge library
UseCase Forge — command-driven UseCase runtime.
Classes
-
UseCase<
S> - Configures and runs one command-driven UseCase.
- UseCaseClock
- A clock used by UseCase Forge for execution timestamps and delayed input policies.
- UseCaseCommand
- Base command contract for UseCase Forge.
- UseCaseDebounceInstructions
- Trailing debounce configuration (only mode in v0).
-
UseCaseErrorContext<
S> - Read-only error payload delivered to UseCase.onError.
-
UseCaseExecutionContext<
S> - Operations available to a command handler while its execution is active.
-
UseCaseExecutionEntry<
C extends UseCaseCommand> - Immutable runtime record for one accepted command invocation.
- UseCaseExecutionGroupKey
- Composite grouping key: exact command Type + user executionKey.
- UseCaseExecutionId
- Local monotonic execution identity within one UseCase instance.
- UseCaseInputInstructionOverrides
-
Partial input overrides. Omit a field to leave the parent value;
pass an explicit
nullto clear debounce/throttle/rateLimit. - UseCaseInputInstructions
- Fully resolved input instructions stored on an Entry.
- UseCaseInstructionOverrides
- Nested instruction overrides fixed for one registered command type.
- UseCaseInstructions
- Fully resolved instructions embedded in an Entry.
- UseCaseProcessingInstructionOverrides
- Partial processing overrides (null field = leave parent value).
- UseCaseProcessingInstructions
- Fully resolved processing instructions stored on an Entry.
- UseCaseRateLimitInstructions
-
UseCaseSnapshot<
S> - Immutable published UseCase state plus execution publication context.
- UseCaseThrottleInstructions
- UseCaseTimer
- A cancellable callback scheduled by a UseCaseClock.
Enums
- UseCaseCommandErrorAction
- Decision returned by a command-specific error handler.
- UseCaseCommandRejectionReason
- Why an Entry was rejected before becoming a historical execution.
- UseCaseErrorStage
- Lifecycle stage where an error was observed.
- UseCaseExecutionMode
- Scheduling relative to other executions.
- UseCaseExecutionPhase
- Structural location of an execution in the runtime.
- UseCaseExecutionResult
- Terminal (or provisional during processing) outcome of an execution.
- UseCaseExistingExecutionPolicy
- Policy toward related active executions.
- UseCaseInputConflictPolicy
- How related pending/admission entries interact.
- UseCaseThrottleMode
Typedefs
-
UseCaseCommandErrorHandler<
T extends UseCaseCommand, S> = Future< UseCaseCommandErrorAction> Function(T command, UseCaseExecutionContext<S> context, Object error, StackTrace stackTrace) - Handles errors from the business handler registered for one command type.
-
UseCaseCommandHandler<
T extends UseCaseCommand, S> = Future< void> Function(T command, UseCaseExecutionContext<S> context) - Registered business handler for an exact command Type.
Exceptions / Errors
- UseCaseClosedException
- Thrown when UseCase.add is called after close started.
- UseCaseCommandAlreadyRegisteredException
- Thrown when UseCase.registerCommand is called twice for the same type.
- UseCaseCommandHandlerNotFoundException
- Thrown when no exact-type handler is registered for a command.
- UseCaseExecutionAlreadyFinishedException
- Thrown when publish/cancel targets an already finished execution.
- UseCaseExecutionKeyRequiredException
- Thrown when resolved instructions require UseCaseCommand.executionKey.
- UseCaseInvalidExecutionTransitionException
- Thrown when an internal lifecycle invariant is violated.