Documentation
¶
Overview ¶
Package state is the chassis `state` inlet: the dispatcher that presents committed state transitions (chassis/state's transactional outbox) into their tenant's `_state/0` stack, at least once each.
It is the scheduled poller's shape — reclaim stale claims, atomically CLAIM due events (the claim is the fleet coordination), fire them onto the bus, record an outcome — with one difference that is the point of it: a claim closes at ACCEPTANCE, not completion. The processor tells the inlet (Envelope.Accepted) the moment an event has been routed into its tenant and admitted, before the tenant's stack runs, and the event is `done` right there. A long `_state` run never holds a delivery claim open, and a response timeout is never read as "delivered": an event that was not accepted goes back to the queue.
The bus re-entry mirrors scheduled: detectTenantBody routes `_txc.src=state` + `_txc.state.tenant` into the tenant's `_state/0`.
Index ¶
Constants ¶
const SubscriptionStack = "_state"
SubscriptionStack is the tenant-level stack that receives state events. Its existence (an active version) is the subscription.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the state inlet. It satisfies the server's Start()/Stop() controller contract.
func NewController ¶
func NewController(ctx context.Context, pu *processor.Unit, store *chstate.Store, wake <-chan struct{}) *Controller
NewController builds the state controller around an opened store. A nil store (state personality not active) yields an inert controller whose Start is a no-op. wake may be nil.
func (*Controller) Start ¶
func (c *Controller) Start()
Start launches the poll loop. No-op when the personality is off or no store was opened.
func (*Controller) Stop ¶
func (c *Controller) Stop()