Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
BytesToString convert []byte type to string type
func NewUUIDWorker ¶
NewUUIDWorker 指定一个节点id,返回该节点对应的uuid生成器 使用多个uuidWorker时,id由调用者保证不重复
func StringToBytes ¶
StringToBytes convert string type to []byte type
Types ¶
type MsgQueue ¶
type MsgQueue struct {
// contains filtered or unexported fields
}
MsgQueue 是一个双缓冲队列的BlockingQueue 在"多生产者,单消费者"的场景下下保证线程安全
func NewMsgQueueWithCap ¶
NewMsgQueueWithCap 创建并返回一个指定初始容量的消息队列
func (*MsgQueue) Pick ¶
func (q *MsgQueue) Pick(retList *[]interface{})
Pick 获取当前队列中的所有元素,若当前队列为空,则阻塞直至有新元素被添加
func (*MsgQueue) PickWithCtx ¶
PickWithCtx 与Pick相同,但当ctx active时,强制退出阻塞状态并返回
func (*MsgQueue) PickWithSignal ¶
func (q *MsgQueue) PickWithSignal(signal <-chan struct{}, retList *[]interface{})
PickWithSignal 与Pick相同,但当signal active时,强制退出阻塞状态并返回
Click to show internal directories.
Click to hide internal directories.