channelmonitor

package
v2.0.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: Apache-2.0, MIT Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Max time to wait for other side to accept open channel request before attempting restart.
	// Set to 0 to disable timeout.
	AcceptTimeout time.Duration
	// Debounce when restart is triggered by multiple errors
	RestartDebounce time.Duration
	// Backoff after restarting
	RestartBackoff time.Duration
	// Number of times to try to restart before failing
	MaxConsecutiveRestarts uint32
	// Max time to wait for the responder to send a Complete message once all
	// data has been sent.
	// Set to 0 to disable timeout.
	CompleteTimeout time.Duration
	// Called when a restart completes successfully
	OnRestartComplete func(id datatransfer.ChannelID)
}

type Monitor

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

Monitor watches the events for data transfer channels, and restarts a channel if there are timeouts / errors

func NewMonitor

func NewMonitor(mgr monitorAPI, cfg *Config) *Monitor

func (*Monitor) AddPullChannel

func (m *Monitor) AddPullChannel(chid datatransfer.ChannelID) *monitoredChannel

AddPullChannel adds a pull channel to the channel monitor

func (*Monitor) AddPushChannel

func (m *Monitor) AddPushChannel(chid datatransfer.ChannelID) *monitoredChannel

AddPushChannel adds a push channel to the channel monitor

func (*Monitor) Shutdown

func (m *Monitor) Shutdown()

Jump to

Keyboard shortcuts

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