primus.command_worker.application module

Provider-neutral command application service.

exception primus.command_worker.application.AuthorizationDenied

Bases: PermissionError

Submission was denied or its target is not registered.

__init__() → None
exception primus.command_worker.application.CommandNotFound(command_id: str)

Bases: LookupError

A tenant-scoped command lookup did not resolve or was not authorized.

__init__(command_id: str) → None
class primus.command_worker.application.CommandService(repository: CommandRepository, clock: Clock, command_ids: CommandIdGenerator, authorizer: CommandAuthorizer, audit: AuditSink, limits: CommandLimits = CommandLimits(max_identifier_length=256, max_idempotency_key_length=512, max_json_depth=32, max_json_containers=10000, max_json_bytes=1048576))

Bases: object

Application boundary for context verified by an authentication adapter.

__init__(repository: CommandRepository, clock: Clock, command_ids: CommandIdGenerator, authorizer: CommandAuthorizer, audit: AuditSink, limits: CommandLimits = CommandLimits(max_identifier_length=256, max_idempotency_key_length=512, max_json_depth=32, max_json_containers=10000, max_json_bytes=1048576)) → None
cancel(context: AuthenticatedCommandContext, command_id: str) → CancellationResult
get(context: AuthenticatedCommandContext, command_id: str) → CommandRecord
submit(context: AuthenticatedCommandContext, request: CommandRequest) → SubmissionResult
exception primus.command_worker.application.IdempotencyConflict

Bases: ValueError

An actor reused an idempotency key for different canonical work.

__init__() → None
class primus.command_worker.application.UUIDCommandIdGenerator

Bases: object

new_id() → str