Documentation
¶
Overview ¶
Package actorlock serializes lifecycle RPCs per actor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelableMutex ¶
type CancelableMutex struct {
// contains filtered or unexported fields
}
CancelableMutex supports context cancellation while waiting for a lock.
func NewCancelableMutex ¶
func NewCancelableMutex() *CancelableMutex
NewCancelableMutex returns an unlocked CancelableMutex.
func (*CancelableMutex) Lock ¶
func (m *CancelableMutex) Lock()
Lock acquires the mutex, blocking until it is free.
func (*CancelableMutex) LockContext ¶
func (m *CancelableMutex) LockContext(ctx context.Context) bool
LockContext returns false on cancellation without acquiring the mutex.
type InFlight ¶
type InFlight struct {
// contains filtered or unexported fields
}
InFlight tracks lifecycle RPCs by actor for shutdown cancellation and draining.
func (*InFlight) Add ¶
func (f *InFlight) Add(actorUID, name string, cancel context.CancelFunc) func()
Add records an RPC for actorUID and returns the function that clears it. cancel is nil for an RPC that must finish, such as a checkpoint saving state.
func (*InFlight) CancelStartups ¶
CancelStartups cancels startup RPCs and returns their actor UIDs.
type Locks ¶
type Locks struct {
// contains filtered or unexported fields
}
Locks serializes lifecycle RPCs per actor.
func (*Locks) Busy ¶ added in v0.5.0
Busy reports whether a lifecycle RPC holds or is waiting for the named actor's lock. It never blocks, so a reader that must not take the lock can still tell whether the actor is mid-operation. The answer may be stale by the time it returns: use it for advisory checks, not to decide lifecycle actions.