func PublishChannelSize(size int) Option {
	return optionFunc(func(opts *options) {
		opts.publishChSize = size
	})
}
PublishChannelSize sets the size of a channel that contains messages that will be sent later.
package kiara
import (
	"github.com/genkami/kiara/codec/gob"
	"github.com/genkami/kiara/types"
)
const (
	defaultPublishChannelSize   = 100
	defaultDeliveredChannelSize = 100
	defaultErrorChannelSize     = 100
)
type options struct {
	publishChSize   int
	deliveredChSize int
	errorChSize     int
	codec           types.Codec
}
func defaultOptions() options {
	return options{
		publishChSize:   defaultPublishChannelSize,
		deliveredChSize: defaultDeliveredChannelSize,
		errorChSize:     defaultErrorChannelSize,
		codec:           gob.Codec,
	}
}
type Option interface {
	apply(*options)
}
type optionFunc func(*options)
func (f optionFunc) apply(opts *options) {
	f(opts)
}
func WithCodec(codec types.Codec) Option {
	return optionFunc(func(opts *options) {
		opts.codec = codec
	})
}