queue

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	PoolNum uint
	// contains filtered or unexported fields
}

func NewMemory

func NewMemory(poolNum uint) *Memory

NewMemory 内存模式

func (*Memory) Append

func (m *Memory) Append(message storage.Messager) error

func (*Memory) Register

func (m *Memory) Register(name string, f storage.ConsumerFunc)

func (*Memory) Run

func (m *Memory) Run()

func (*Memory) Shutdown

func (m *Memory) Shutdown()

func (*Memory) String

func (*Memory) String() string

type Message

type Message struct {
	redisqueue.Message
}

func (*Message) GetID

func (m *Message) GetID() string

func (*Message) GetPrefix

func (m *Message) GetPrefix() (prefix string)

func (*Message) GetStream

func (m *Message) GetStream() string

func (*Message) GetValues

func (m *Message) GetValues() map[string]interface{}

func (*Message) SetID

func (m *Message) SetID(id string)

func (*Message) SetPrefix

func (m *Message) SetPrefix(prefix string)

func (*Message) SetStream

func (m *Message) SetStream(stream string)

func (*Message) SetValues

func (m *Message) SetValues(values map[string]interface{})

type NSQ

type NSQ struct {
	// contains filtered or unexported fields
}

func NewNSQ

func NewNSQ(addresses []string, cfg *nsq.Config, channelPrefix string) (*NSQ, error)

NewNSQ nsq模式 只能监听一个channel

func (*NSQ) Append

func (e *NSQ) Append(message storage.Messager) error

Append 消息入生产者

func (*NSQ) Register

func (e *NSQ) Register(name string, f storage.ConsumerFunc)

Register 监听消费者

func (*NSQ) Run

func (e *NSQ) Run()

func (*NSQ) Shutdown

func (e *NSQ) Shutdown()

func (NSQ) String

func (NSQ) String() string

String 字符串类型

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

Redis cache implement

func NewRedis

func NewRedis(
	producerOptions *redisqueue.ProducerOptions,
	consumerOptions *redisqueue.ConsumerOptions,
) (*Redis, error)

NewRedis redis模式

func (*Redis) Append

func (r *Redis) Append(message storage.Messager) error

func (*Redis) Register

func (r *Redis) Register(name string, f storage.ConsumerFunc)

func (*Redis) Run

func (r *Redis) Run()

func (*Redis) Shutdown

func (r *Redis) Shutdown()

func (Redis) String

func (Redis) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL