func NewBroker() *Broker {
	opts := defaultBrokerOptions()
	b := &Broker{
		adapters: newAdapterSet(),
		messages: make(chan *types.Message, opts.messagesChSize),
		opts:     opts,
		done:     make(chan struct{}),
	}
	go b.run()
	return b
}
NewBroker creates a new Broker.
package inmemory
import (
	"errors"
	"log"
	"sync"
	"github.com/genkami/kiara/types"
)
var (
	ErrAlreadySubscribed = errors.New("already subscribed")
	ErrNotSubscribed     = errors.New("not subscribed")
)
type Broker struct {
	lock     sync.RWMutex
	messages chan *types.Message
	adapters adapterSet
	opts     brokerOptions
	done     chan struct{}
}