onidle

package
v1.14.1-rc.3 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Overview

Package onidle provides server chain element that executes a callback when there were no active connections for specified time

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(ctx context.Context, notify func(), timeout time.Duration) networkservice.NetworkServiceServer

NewServer returns a new server chain element that notifies about long time periods without active connections.

If timeout passes, server calls specified notify function and all further Requests will fail.

Zero timeout disables onidle server altogether. Setting timeout=0 is equivalent to using null.NewServer.

If ctx is canceled before timeout, the server stops monitoring connections without calling notify. Further calls to Request will not be affected by this.

Types

This section is empty.

Jump to

Keyboard shortcuts

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