feat: Add connection

This commit is contained in:
sujit
2024-10-21 21:49:43 +05:45
parent 35a79be4ad
commit 48918f1903
6 changed files with 177 additions and 64 deletions

View File

@@ -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) {