forked from uber/cadence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
const.go
116 lines (108 loc) · 5.39 KB
/
const.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Copyright (c) 2019 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package canary
import (
"time"
"go.uber.org/cadence/workflow"
)
// global constants
const (
workflowRetentionDays = int32(1)
activityWorkerMaxExecutors = 256
scheduleToStartTimeout = 3 * time.Minute
decisionTaskTimeout = 10 * time.Second
activityTaskTimeout = 3 * time.Minute
childWorkflowTimeout = 6 * time.Minute
taskListName = "canary-task-queue"
crossClusterSrcTasklist = "cross-cluster-src-tasklist"
crossClusterDestTasklist = "cross-cluster-dest-tasklist"
ctxKeyActivityRuntime = contextKey("runtime")
ctxKeyActivityArchivalRuntime = contextKey("runtime-archival")
ctxKeyActivitySystemClient = contextKey("system-client")
ctxKeyActivityBatcherClient = contextKey("batcher-client")
ctxKeyConfig = contextKey("runtime-config")
archivalDomain = "canary-archival-domain"
archivalTaskListName = "canary-archival-task-queue"
)
// canary running modes
const (
ModeAll = "all"
ModeWorker = "worker"
ModeCronCanary = "cronCanary"
)
// workflowVersion represents the current version of every single
// workflow function in this canary. Every workflow function verifies
// that the decision task it is executing is compatible with this version
// Bump this version whenever a backward incompatible change for any workflow
// also see beingWorkflow function
const workflowVersion = workflow.Version(3)
const workflowChangeID = "initial version"
// wfType/activityType refers to the friendly short names given to
// workflows and activities - at the time of registration, these names
// will be used to associate with a workflow or activity function
const (
wfTypeCron = "workflow.cron"
wfTypeSanity = "workflow.sanity"
wfTypeEcho = "workflow.echo"
wfTypeSignal = "workflow.signal"
wfTypeSignalExternal = "workflow.signal.external"
wfTypeVisibility = "workflow.visibility"
wfTypeSearchAttributes = "workflow.searchAttributes"
wfTypeConcurrentExec = "workflow.concurrent-execution"
wfTypeQuery = "workflow.query"
wfTypeTimeout = "workflow.timeout"
wfTypeLocalActivity = "workflow.localactivity"
wfTypeCancellation = "workflow.cancellation"
wfTypeCancellationExternal = "workflow.cancellation.external"
wfTypeRetry = "workflow.retry"
wfTypeResetBase = "workflow.reset.base"
wfTypeReset = "workflow.reset"
wfTypeHistoryArchival = "workflow.archival.history"
wfTypeVisibilityArchival = "workflow.archival.visibility"
wfTypeArchivalExternal = "workflow.archival.external"
wfTypeBatch = "workflow.batch"
wfTypeCrossClusterParent = "workflow.CrossCluster.parent"
wfTypeCrossClusterChild = "workflow.CrossCluster.child"
wfTypeBatchParent = "workflow.batch.parent"
wfTypeBatchChild = "workflow.batch.child"
activityTypeEcho = "activity.echo"
activityTypeCron = "activity.cron"
activityTypeSignal = "activity.signal"
activityTypeVisibility = "activity.visibility"
activityTypeSearchAttributes = "activity.searchAttributes"
activityTypeConcurrentExec = "activity.concurrent-execution"
activityTypeQuery1 = "activity.query1"
activityTypeQuery2 = "activity.query2"
activityTypeTimeout = "activity.timeout"
activityTypeCancellation = "activity.cancellation"
activityTypeCancellationChild = "activity.cancellation.child"
activityTypeRetryOnTimeout = "activity.retry-on-timeout"
activityTypeRetryOnFailure = "activity.retry-on-failure"
activityTypeTriggerReset = "activity.reset.trigger"
activityTypeVerifyReset = "activity.reset.verify"
activityTypeResetBase = "activity.reset.base"
activityTypeHistoryArchival = "activity.archival.history"
activityTypeVisibilityArchival = "activity.archival.visibility"
activityTypeLargeResult = "activity.largeResult"
activityTypeVerifyBatch = "activity.batch.verify"
activityTypeStartBatch = "activity.batch.start.batch"
activityTypeCrossCluster = "activity.crosscluster.sample"
activityTypeCrossClusterFailover = "activity.crosscluster.failover"
)