Documentation
¶
Overview ¶
Package client is one client of a lock server: it asks for the lock, holds it once granted, and releases it. New can also build a client that is not idempotent under duplicated grants, for the acceptance tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actions ¶
type Actions uint64
Actions is the set of things the holder must do after a transition, one bit each. The holder performs them in declaration order. The zero value is the empty set.
type Event ¶
type Event uint8
Event is an input to Fire.
const ( EvWant Event EvGrant EvDone )
Event values.
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine is one client. Build it with New and change it only with Fire.
func New ¶
New returns a client in Idle. With acceptStale it is the seeded bug: it takes any grant, even when not waiting, so a duplicated grant makes it hold the lock again.