lease

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLeaseNotRcv         = errors.New("rsocket: lease was not received yet")
	ErrLeaseExpired        = errors.New("rsocket: lease expired")
	ErrLeaseNoMoreRequests = errors.New("rsocket: no more lease")
)

lease errors

Functions

This section is empty.

Types

type Factory added in v0.6.0

type Factory interface {
	// Next generate next lease chan.
	Next(ctx context.Context) (ch chan Lease, ok bool)
}

Factory can be used to generate leases.

func NewSimpleFactory added in v0.6.0

func NewSimpleFactory(interval, ttl, delay time.Duration, numberOfRequest uint32) (Factory, error)

NewSimpleFactory creates a simple lease factory.

type Lease

type Lease struct {
	TimeToLive       time.Duration
	NumberOfRequests uint32
	Metadata         []byte
}

Lease represents lease structure.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL