Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrQueueClosed = errors.New("queue is closed")
ErrQueueClosed queue is closed
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `yaml:"name" json:"name"` BatchSize int `yaml:"batchSize" json:"batchSize" default:"10"` ExpireTime time.Duration `yaml:"expireTime" json:"expireTime" default:"168h"` CleanInterval time.Duration `yaml:"cleanInterval" json:"cleanInterval" default:"1h"` WriteTimeout time.Duration `yaml:"writeTimeout" json:"writeTimeout" default:"100ms"` DeleteTimeout time.Duration `yaml:"deleteTimeout" json:"deleteTimeout" default:"500ms"` }
Config queue config
type Encoder ¶
type Encoder struct{}
type Persistence ¶
Persistence is a persistent queue
func (*Persistence) Chan ¶
func (q *Persistence) Chan() <-chan *common.Event
Chan returns message channel
func (*Persistence) Close ¶
func (q *Persistence) Close(clean bool) error
Close closes this queue and clean queue data when cleanSession is true
type Queue ¶
type Queue interface { Push(*common.Event) error Pop() (*common.Event, error) Chan() <-chan *common.Event Close(bool) error }
Queue interfaces
func NewPersistence ¶
NewPersistence creates a new persistent queue
Click to show internal directories.
Click to hide internal directories.