65
counterFactory func() counter.Counter,
66
isDraining bool,
68
>
// For the purposes of taskQueueDB, call this just a TaskManager. It'll return errors if we
69
>
// use it incorectly. TODO(fairness): consider a cleaner way of doing this.
70
>
taskManager := persistence.TaskManager(fairTaskManager)
71
>
72
>
bmg := &fairBacklogManagerImpl{
73
>
pqMgr: pqMgr,
74
>
config: config,
75
>
tqCtx: tqCtx,
76
>
isDraining: isDraining,
77
>
db: newTaskQueueDB(config, taskManager, pqMgr.QueueKey(), logger, metricsHandler, isDraining),
78
>
subqueuesByPriority: make(map[priorityKey]subqueueIndex),
79
>
priorityBySubqueue: make(map[subqueueIndex]priorityKey),
80
>
matchingClient: matchingClient,
81
>
metricsHandler: metricsHandler,
82
>
counterFactory: counterFactory,
83
>
logger: logger,
84
>
throttledLogger: throttledLogger,
85
>
initializedError: future.NewFuture[struct{}](),
86
>
}
87
>
bmg.taskWriter = newFairTaskWriter(bmg, bmg.newCounterForSubqueue)
88
>
return bmg
89
>
}
90
91
// signalIfFatal calls UnloadFromPartitionManager of the physicalTaskQueueManager