MCPcopy Create free account
hub / github.com/temporalio/temporal / newTaskPersistence

Function newTaskPersistence

common/persistence/sql/task_store.go:25–48  ·  view source on GitHub ↗

newTaskPersistence creates a new instance of TaskStore

(
	db sqlplugin.DB,
	taskScanPartitions int,
	logger log.Logger,
	enableFairness bool,
	serializer serialization.Serializer,
)

Source from the content-addressed store, hash-verified

23
24// newTaskPersistence creates a new instance of TaskStore
25func newTaskPersistence(
26 db sqlplugin.DB,
27 taskScanPartitions int,
28 logger log.Logger,
29 enableFairness bool,
30 serializer serialization.Serializer,
31) (persistence.TaskStore, error) {
32 store := SqlStore{
33 DB: db,
34 logger: logger,
35 serializer: serializer,
36 }
37 userDataStore := userDataStore{SqlStore: store}
38 taskQueueStore := taskQueueStore{
39 SqlStore: store,
40 version: sqlplugin.MatchingTaskVersion1,
41 taskScanPartitions: uint32(taskScanPartitions),
42 }
43 if enableFairness {
44 taskQueueStore.version = sqlplugin.MatchingTaskVersion2
45 return newTaskManagerV2(db, userDataStore, taskQueueStore, logger, serializer)
46 }
47 return newTaskManagerV1(db, userDataStore, taskQueueStore, logger, serializer)
48}

Callers 2

NewTaskStoreMethod · 0.85
NewFairTaskStoreMethod · 0.85

Calls 2

newTaskManagerV2Function · 0.85
newTaskManagerV1Function · 0.85

Tested by

no test coverage detected