Messages

Message base classes.

Command and Event are two types used to handle changes in the model.

class purgatory.domain.messages.base.Message

Base class for messaging.

class purgatory.domain.messages.base.Command

Baseclass for message of type command.

class purgatory.domain.messages.base.Event

Baseclass for message of type event.

Commands

class purgatory.domain.messages.commands.CreateCircuitBreaker(name: str, threshold: int, ttl: float)
name: str
threshold: int
ttl: float

Events

class purgatory.domain.messages.events.CircuitBreakerCreated(name: str, threshold: int, ttl: float)
name: str
threshold: int
ttl: float
class purgatory.domain.messages.events.ContextChanged(name: str, state: Literal['opened', 'closed', 'half-opened'], opened_at: float | None)
name: str
state: Literal['opened', 'closed', 'half-opened']
opened_at: float | None
class purgatory.domain.messages.events.CircuitBreakerFailed(name: str, failure_count: int)
name: str
failure_count: int
class purgatory.domain.messages.events.CircuitBreakerRecovered(name: str)
name: str