ceremonyclient/go-libp2p/p2p/net/connmgr/watchdog_cgo.go
2023-08-20 23:07:43 -05:00

18 lines
400 B
Go

//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
}
}