dq

package
v0.0.0-...-8cdaf41 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init 延时队列初始化

func Pop

func Pop(c *gin.Context)

Pop 出队

func Push

func Push(c *gin.Context)

Push 入队

Types

type BucketItem

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

BucketItem bucket中的元素

type Job

type Job struct {
	Topic string `json:"topic" msgpack:"1"`
	ID    string `json:"id" msgpack:"2"`    // job唯一标识ID
	Delay int64  `json:"delay" msgpack:"3"` // 延迟时间, unix时间戳
	Body  string `json:"body" msgpack:"4"`
}

Job 使用msgpack序列化后保存到Redis,减少内存占用

Jump to

Keyboard shortcuts

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