Documentation ¶
Index ¶
Constants ¶
View Source
const ( CodeSuccess = 100 CodeTooManyRequest = 101 )
View Source
const ( DelayBucket = "later_delay" UnackBucket = "later_unack" ErrorBucket = "later_error" )
Variables ¶
View Source
var ( RedisConnectTimeout = 50 * time.Millisecond RedisReadTimeout = 50 * time.Millisecond RedisWriteTimeout = 100 * time.Millisecond RedisPoolMaxIdle = 200 RedisPoolIdleTimeout = 3 * time.Minute )
View Source
var ( TaskTTL = 24 * 3600 ZrangeCount = 20 RetryInterval = 10 //second DelayWorkerInterval = 100 * time.Millisecond UnackWorkerInterval = 1000 * time.Millisecond ErrorWorkerInterval = 1000 * time.Millisecond )
View Source
var ( CallbackTTR = 3 * time.Second //time to run MaxIdleConnsPerHost = 10 MaxIdleConns = 1024 IdleConnTimeout = time.Minute * 5 )
Functions ¶
func ListenAndServe ¶
Types ¶
type Task ¶
type Task struct { // ID is a global unique id ID string // Topic use to classify tasks Topic string // ExecuteTime is the time to deliver ExecuteTime int64 // MaxRetry is max deliver retry times MaxRetry int //HasRetry is the current retry times HasRetry int // Callback is the deliver address Callback string // Content is the task content to deliver Content string // CreatTime is the time task created CreatTime int64 }
Task is the task to execute
Source Files ¶
Click to show internal directories.
Click to hide internal directories.