Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = boskos.ErrNotFound
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Acquire leases `n` resources and returns the lease names. // Will block until resources are available or 150m pass, `n` must be > 0. // `ctx` can be used to abort the operation, `cancel` is called if any // subsequent updates to the lease fail. Acquire(rtype string, n uint, ctx context.Context, cancel context.CancelFunc) ([]string, error) //AcquireIfAvailableImmediately leases `n` resources and returns the lease names. // Does not block, and only leases the resources if they are available right away. AcquireIfAvailableImmediately(rtype string, n uint, cancel context.CancelFunc) ([]string, error) // Heartbeat updates all leases. It calls the cancellation function of each // lease it fails to update. Heartbeat() error // Release ends one lease by name. Release(name string) error // ReleaseAll ends all leases and returns the names of those that were // successfully released. ReleaseAll() ([]string, error) // Metrics queries the states of a particular resource, for informational // purposes. Metrics(rtype string) (Metrics, error) }
Client manages resource leases, acquiring, releasing, and keeping them updated.
Click to show internal directories.
Click to hide internal directories.