mirror of
https://github.com/HDT3213/delayqueue.git
synced 2025-10-05 23:26:49 +08:00
add more tests
This commit is contained in:
10
monitor.go
10
monitor.go
@@ -18,7 +18,7 @@ func NewMonitor0(name string, cli RedisCli, opts ...interface{}) *Monitor {
|
||||
}
|
||||
}
|
||||
|
||||
// NewPublisher creates a new Publisher by a *redis.Client
|
||||
// NewMonitor creates a new Monitor by a *redis.Client
|
||||
func NewMonitor(name string, cli *redis.Client, opts ...interface{}) *Monitor {
|
||||
rc := &redisV9Wrapper{
|
||||
inner: cli,
|
||||
@@ -26,6 +26,14 @@ func NewMonitor(name string, cli *redis.Client, opts ...interface{}) *Monitor {
|
||||
return NewMonitor0(name, rc, opts...)
|
||||
}
|
||||
|
||||
// NewMonitor creates a new Monitor by a *redis.ClusterClient
|
||||
func NewMonitorOnCluster(name string, cli *redis.ClusterClient, opts ...interface{}) *Monitor {
|
||||
rc := &redisClusterWrapper{
|
||||
inner: cli,
|
||||
}
|
||||
return NewMonitor0(name, rc, opts...)
|
||||
}
|
||||
|
||||
// WithLogger customizes logger for queue
|
||||
func (m *Monitor) WithLogger(logger *log.Logger) *Monitor {
|
||||
m.inner.logger = logger
|
||||
|
Reference in New Issue
Block a user