token

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Errors

type Errors []error

func (Errors) Error

func (es Errors) Error() string

type Tokens

type Tokens struct {
	// contains filtered or unexported fields
}

func NewTokens

func NewTokens() *Tokens

func (*Tokens) Append

func (ts *Tokens) Append(name string, t mqtt.Token)

func (*Tokens) Done

func (ts *Tokens) Done() <-chan struct{}

Done returns a channel that is closed when the flow associated with the Token completes. Clients should call Error after the channel is closed to check if the flow completed successfully.

Done is provided for use in select statements. Simple use cases may use Wait or WaitTimeout.

func (*Tokens) Error

func (ts *Tokens) Error() error

func (*Tokens) Wait

func (ts *Tokens) Wait() bool

Wait will wait indefinitely for the Token to complete, ie the Publish to be sent and confirmed receipt from the broker.

func (*Tokens) WaitTimeout

func (ts *Tokens) WaitTimeout(d time.Duration) bool

WaitTimeout takes a time.Duration to wait for the flow associated with the Token to complete, returns true if it returned before the timeout or returns false if the timeout occurred. In the case of a timeout the Token does not have an error set in case the caller wishes to wait again.

Jump to

Keyboard shortcuts

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