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.
Click to show internal directories.
Click to hide internal directories.