ceremonyclient/go-libp2p/p2p/net/connmgr/watchdog_cgo.go

18 lines
400 B
Go
Raw Normal View History

2023-08-21 03:50:38 +00:00
//go:build cgo && !nowatchdog
package connmgr
import "github.com/raulk/go-watchdog"
func registerWatchdog(cb func()) (unregister func()) {
return watchdog.RegisterPostGCNotifee(cb)
}
// WithEmergencyTrim is an option to enable trimming connections on memory emergency.
func WithEmergencyTrim(enable bool) Option {
return func(cfg *config) error {
cfg.emergencyTrim = enable
return nil
}
}