Documentation
¶
Overview ¶
Package pull provides a reliable way to subscribe to changes from a device.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Changes ¶
Changes calls Pull on poller unless it's not supported, in which case it polls. It will retry on error, backing off exponentially up to a maximum delay. It will return if the context is cancelled or a non-recoverable error occurs.
Types ¶
type Fetcher ¶
type Fetcher[C any] interface { // Pull blocks subscribing to changes and sends them on the given channel. // Retries and reconnects are managed by the caller. Pull(ctx context.Context, changes chan<- C) error // Poll queries for the current value sending it on the given channel. // Delays between polls are managed by the caller. Poll(ctx context.Context, changes chan<- C) error }
Fetcher can pull and poll for changes.
Click to show internal directories.
Click to hide internal directories.