Timeouts
// WithTimeout completes the `ConnHandler` interface.
// Can be used to register namespaces and events or just events on an empty namespace
// with Read and Write timeouts.
//
// See `New` and `Dial`.
type WithTimeout struct {
ReadTimeout time.Duration
WriteTimeout time.Duration
Namespaces Namespaces
Events Events
}var events = neffos.WithTimeout {
ReadTimeout: 60 * time.Second,
WriteTimeout: 60 * time.Second,
Namespaces: neffos.Namespaces {
"namespace": neffos.Events {
"onMyEvent": func(c *neffos.NSConn, msg neffos.Message) error {
// [...]
},
},
},
}Last updated