99
}
100
101
>
func NewImmutable(histories ...[]*historypb.HistoryEvent) *HistoryBuilder {
history_builder.go
102
>
lastHistory := histories[len(histories)-1]
103
>
lastEvent := lastHistory[len(lastHistory)-1]
104
>
return &HistoryBuilder{
105
>
EventStore: EventStore{
106
>
state: HistoryBuilderStateImmutable,
107
>
timeSource: nil,
108
>
taskIDGenerator: nil,
109
>
110
>
version: lastEvent.GetVersion(),
111
>
nextEventID: lastEvent.GetEventId() + 1,
112
>
113
>
workflowFinished: false,
114
>
115
>
dbBufferBatch: nil,
116
>
dbClearBuffer: false,
117
>
memEventsBatches: histories,
118
>
memLatestBatch: nil,
119
>
memBufferBatch: nil,
120
>
scheduledIDToStartedID: nil,
121
>
requestIDToEventID: nil,
122
>
123
>
metricsHandler: nil,
124
>
},
125
>
EventFactory: EventFactory{},
126
>
}
127
>
}
128
129
func NewImmutableForUpdateNextEventID(lastVersionHistoryItem *historyspb.VersionHistoryItem) *HistoryBuilder {