go-eventbus/opts.go

21 lines
745 B
Go
Raw Normal View History

2019-06-19 23:55:25 +08:00
package eventbus
2019-06-13 10:23:03 +08:00
2022-08-18 19:50:59 +08:00
import "github.com/libp2p/go-libp2p/p2p/host/eventbus"
2022-08-18 19:50:59 +08:00
// Deprecated: Use github.com/libp2p/go-libp2p/p2p/host/eventbus.BufSize instead.
2019-06-22 00:50:36 +08:00
func BufSize(n int) func(interface{}) error {
2022-08-18 19:50:59 +08:00
return eventbus.BufSize(n)
2019-06-17 03:42:47 +08:00
}
2020-06-19 22:54:02 +08:00
// Stateful is an Emitter option which makes the eventbus channel
2019-06-19 20:13:48 +08:00
// 'remember' last event sent, and when a new subscriber joins the
// bus, the remembered event is immediately sent to the subscription
// channel.
//
// This allows to provide state tracking for dynamic systems, and/or
// allows new subscribers to verify that there are Emitters on the channel
2022-08-18 19:50:59 +08:00
// Deprecated: Use github.com/libp2p/go-libp2p/p2p/host/eventbus.Stateful instead.
2019-06-19 21:36:31 +08:00
func Stateful(s interface{}) error {
2022-08-18 19:50:59 +08:00
return eventbus.Stateful(s)
2019-06-17 03:42:47 +08:00
}