Documentation ¶
Overview ¶
Package webstream provides controls for streaming from the web server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamSource ¶
func StreamSource(ctx context.Context, source gostream.ImageSource, stream gostream.Stream, backoffOpts *BackoffTuningOptions)
StreamSource starts a stream from an image source with a throttled error handler.
Types ¶
type BackoffTuningOptions ¶
type BackoffTuningOptions struct { // BaseSleep sets the initial amount of time to wait after an error. BaseSleep time.Duration // MaxSleep determines the maximum amount of time that streamSource is // permitted to a sleep after receiving a single error. MaxSleep time.Duration }
BackoffTuningOptions represents a set of parameters for determining exponential backoff when receiving multiple simultaneous errors.
BaseSleep is the duration to wait after receiving a new error. After that, the wait time doubles for every subsequent, consecutive error of the same type, until the wait duration reaches the MaxSleep duration.
func (*BackoffTuningOptions) GetSleepTimeFromErrorCount ¶
func (opts *BackoffTuningOptions) GetSleepTimeFromErrorCount(errorCount int) time.Duration
GetSleepTimeFromErrorCount returns a sleep time from an error count.
Click to show internal directories.
Click to hide internal directories.