func NewEventBusWithBufferCapacity(cap int) *EventBus {
	pubsub := tmpubsub.NewServer(tmpubsub.BufferCapacity(cap))
	b := &EventBus{pubsub: pubsub}
	b.BaseService = *service.NewBaseService(nil, "EventBus", b)
	return b
}
NewEventBusWithBufferCapacity returns a new event bus with the given buffer capacity.
package types
import (
	"context"
	"fmt"
	"strings"
	"github.com/tendermint/tendermint/abci/types"
	"github.com/tendermint/tendermint/libs/log"
	tmpubsub "github.com/tendermint/tendermint/libs/pubsub"
	"github.com/tendermint/tendermint/libs/service"
)
const defaultCapacity = 0
type EventBusSubscriber interface {
	Subscribe(ctx context.Context, subscriber string, query tmpubsub.Query, outCapacity ...int) (Subscription, error)
	Unsubscribe(ctx context.Context, args tmpubsub.UnsubscribeArgs) error
	UnsubscribeAll(ctx context.Context, subscriber string) error
	NumClients() int
	NumClientSubscriptions(clientID string) int
}
type Subscription interface {
	ID() string
	Out() <-chan tmpubsub.Message
	Canceled() <-chan struct{}
	Err() error
}
type EventBus struct {
	service.BaseService
	pubsub *tmpubsub.Server
}
func NewEventBus() *EventBus {
	return NewEventBusWithBufferCapacity(defaultCapacity)
}