7
7
"github.com/indeedeng/iwf/service/common/event"
8
8
"github.com/indeedeng/iwf/service/common/ptr"
9
9
"github.com/indeedeng/iwf/service/common/utils"
10
+ "github.com/indeedeng/iwf/service/interpreter/config"
11
+ "github.com/indeedeng/iwf/service/interpreter/cont"
10
12
"github.com/indeedeng/iwf/service/interpreter/env"
11
13
"github.com/indeedeng/iwf/service/interpreter/interfaces"
12
14
"github.com/indeedeng/iwf/service/interpreter/timers"
@@ -72,7 +74,7 @@ func InterpreterImpl(
72
74
}
73
75
}
74
76
75
- workflowConfiger := NewWorkflowConfiger (input .Config )
77
+ workflowConfiger := config . NewWorkflowConfiger (input .Config )
76
78
basicInfo := service.BasicInfo {
77
79
IwfWorkflowType : input .IwfWorkflowType ,
78
80
IwfWorkerUrl : input .IwfWorkerUrl ,
@@ -82,7 +84,7 @@ func InterpreterImpl(
82
84
var stateRequestQueue * StateRequestQueue
83
85
var persistenceManager * PersistenceManager
84
86
var timerProcessor interfaces.TimerProcessor
85
- var continueAsNewCounter * ContinueAsNewCounter
87
+ var continueAsNewCounter * cont. ContinueAsNewCounter
86
88
var signalReceiver * SignalReceiver
87
89
var stateExecutionCounter * StateExecutionCounter
88
90
var outputCollector * OutputCollector
@@ -101,12 +103,12 @@ func InterpreterImpl(
101
103
internalChannel = RebuildInternalChannel (previous .InterStateChannelReceived )
102
104
stateRequestQueue = NewStateRequestQueueWithResumeRequests (previous .StatesToStartFromBeginning , previous .StateExecutionsToResume )
103
105
persistenceManager = RebuildPersistenceManager (provider , previous .DataObjects , previous .SearchAttributes , input .UseMemoForDataAttributes )
106
+ continueAsNewCounter = cont .NewContinueAsCounter (workflowConfiger , ctx , provider )
104
107
if input .Config .GetOptimizeTimer () {
105
- timerProcessor = timers .NewGreedyTimerProcessor (ctx , provider , previous .StaleSkipTimerSignals )
108
+ timerProcessor = timers .NewGreedyTimerProcessor (ctx , provider , continueAsNewCounter , previous .StaleSkipTimerSignals )
106
109
} else {
107
110
timerProcessor = timers .NewSimpleTimerProcessor (ctx , provider , previous .StaleSkipTimerSignals )
108
111
}
109
- continueAsNewCounter = NewContinueAsCounter (workflowConfiger , ctx , provider )
110
112
signalReceiver = NewSignalReceiver (ctx , provider , internalChannel , stateRequestQueue , persistenceManager , timerProcessor , continueAsNewCounter , workflowConfiger , previous .SignalsReceived )
111
113
counterInfo := previous .StateExecutionCounterInfo
112
114
stateExecutionCounter = RebuildStateExecutionCounter (ctx , provider , globalVersioner ,
@@ -118,12 +120,12 @@ func InterpreterImpl(
118
120
internalChannel = NewInternalChannel ()
119
121
stateRequestQueue = NewStateRequestQueue ()
120
122
persistenceManager = NewPersistenceManager (provider , input .InitDataAttributes , input .InitSearchAttributes , input .UseMemoForDataAttributes )
123
+ continueAsNewCounter = cont .NewContinueAsCounter (workflowConfiger , ctx , provider )
121
124
if input .Config .GetOptimizeTimer () {
122
- timerProcessor = timers .NewGreedyTimerProcessor (ctx , provider , nil )
125
+ timerProcessor = timers .NewGreedyTimerProcessor (ctx , provider , continueAsNewCounter , nil )
123
126
} else {
124
127
timerProcessor = timers .NewSimpleTimerProcessor (ctx , provider , nil )
125
128
}
126
- continueAsNewCounter = NewContinueAsCounter (workflowConfiger , ctx , provider )
127
129
signalReceiver = NewSignalReceiver (ctx , provider , internalChannel , stateRequestQueue , persistenceManager , timerProcessor , continueAsNewCounter , workflowConfiger , nil )
128
130
stateExecutionCounter = NewStateExecutionCounter (ctx , provider , globalVersioner , workflowConfiger , continueAsNewCounter )
129
131
outputCollector = NewOutputCollector (nil )
@@ -525,8 +527,8 @@ func processStateExecution(
525
527
signalReceiver * SignalReceiver ,
526
528
timerProcessor interfaces.TimerProcessor ,
527
529
continueAsNewer * ContinueAsNewer ,
528
- continueAsNewCounter * ContinueAsNewCounter ,
529
- configer * WorkflowConfiger ,
530
+ continueAsNewCounter * cont. ContinueAsNewCounter ,
531
+ configer * config. WorkflowConfiger ,
530
532
shouldSendSignalOnCompletion bool ,
531
533
) (* iwfidl.StateDecision , service.StateExecutionStatus , error ) {
532
534
waitUntilApi := StateStart
@@ -832,7 +834,7 @@ func invokeStateExecute(
832
834
executionContext iwfidl.Context ,
833
835
commandRes * iwfidl.CommandResults ,
834
836
continueAsNewer * ContinueAsNewer ,
835
- configer * WorkflowConfiger ,
837
+ configer * config. WorkflowConfiger ,
836
838
executeApi interface {},
837
839
stateExecutionLocal []iwfidl.KeyValue ,
838
840
shouldSendSignalOnCompletion bool ,
0 commit comments