mirror of
https://github.com/oarkflow/mq.git
synced 2025-10-04 15:42:49 +08:00
feat: Add connection
This commit is contained in:
12
options.go
12
options.go
@@ -79,6 +79,7 @@ type Options struct {
|
||||
numOfWorkers int
|
||||
maxMemoryLoad int64
|
||||
syncMode bool
|
||||
cleanTaskOnComplete bool
|
||||
enableWorkerPool bool
|
||||
respondPendingResult bool
|
||||
}
|
||||
@@ -95,6 +96,10 @@ func (o *Options) Storage() TaskStorage {
|
||||
return o.storage
|
||||
}
|
||||
|
||||
func (o *Options) CleanTaskOnComplete() bool {
|
||||
return o.cleanTaskOnComplete
|
||||
}
|
||||
|
||||
func (o *Options) QueueSize() int {
|
||||
return o.queueSize
|
||||
}
|
||||
@@ -186,6 +191,13 @@ func WithSyncMode(mode bool) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithCleanTaskOnComplete -
|
||||
func WithCleanTaskOnComplete() Option {
|
||||
return func(opts *Options) {
|
||||
opts.cleanTaskOnComplete = true
|
||||
}
|
||||
}
|
||||
|
||||
// WithRespondPendingResult -
|
||||
func WithRespondPendingResult(mode bool) Option {
|
||||
return func(opts *Options) {
|
||||
|
Reference in New Issue
Block a user