MCPcopy
hub / github.com/cloudreve/cloudreve / New

Function New

pkg/queue/queue.go:68–90  ·  view source on GitHub ↗
(l logging.Logger, taskClient inventory.TaskClient, registry TaskRegistry, dep Dep, opts ...Option)

Source from the content-addressed store, hash-verified

66)
67
68func New(l logging.Logger, taskClient inventory.TaskClient, registry TaskRegistry, dep Dep, opts ...Option) Queue {
69 o := newDefaultOptions()
70 for _, opt := range opts {
71 opt.apply(o)
72 }
73
74 ctx, cancel := context.WithCancel(context.Background())
75
76 return &queue{
77 routineGroup: newRoutineGroup(),
78 scheduler: NewFifoScheduler(0, l),
79 quit: make(chan struct{}),
80 ready: make(chan struct{}, 1),
81 metric: &metric{},
82 options: o,
83 logger: l,
84 registry: registry,
85 taskClient: taskClient,
86 dep: dep,
87 rootCtx: ctx,
88 cancel: cancel,
89 }
90}
91
92// Start to enable all worker
93func (q *queue) Start() {

Callers 6

ThumbQueueMethod · 0.92
MediaMetaQueueMethod · 0.92
IoIntenseQueueMethod · 0.92
RemoteDownloadQueueMethod · 0.92
EntityRecycleQueueMethod · 0.92
SlaveQueueMethod · 0.92

Calls 4

newDefaultOptionsFunction · 0.85
newRoutineGroupFunction · 0.85
NewFifoSchedulerFunction · 0.85
applyMethod · 0.65

Tested by

no test coverage detected