Skip to content

Commit 9397d6a

Browse files
committed
Cleanup
1 parent a0144ab commit 9397d6a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

service/history/chasm_engine.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ func (e *ChasmEngine) PollComponent(
287287

288288
// At this point it's possible that shard VT < requestRef VT (getExecutionLease does not
289289
// guarantee that returned shard state is non-stale w.r.t. requestRef).
290-
satisfiedRef, err := e.predicateSatisfied(ctx, requestRef, executionLease, monotonicPredicate)
290+
satisfiedRef, err := e.predicateSatisfied(ctx, monotonicPredicate, requestRef, executionLease)
291291
if err != nil {
292292
return nil, err
293293
}
@@ -330,7 +330,7 @@ func (e *ChasmEngine) PollComponent(
330330
}
331331
func() {
332332
defer executionLease.GetReleaseFn()(nil)
333-
satisfiedRef, err = e.predicateSatisfied(ctx, requestRef, executionLease, monotonicPredicate)
333+
satisfiedRef, err = e.predicateSatisfied(ctx, monotonicPredicate, requestRef, executionLease)
334334
if err == nil && satisfiedRef == nil {
335335
ch = e.notifier.Subscribe(requestRef.EntityKey)
336336
}
@@ -348,12 +348,12 @@ func (e *ChasmEngine) PollComponent(
348348
}
349349

350350
// predicateSatisfied is a helper function for PollComponent. It returns (ref, err) where ref is non-nil
351-
// iff there's no error and predicateFn evaluates to true.
351+
// iff there's no error and predicate evaluates to true.
352352
func (e *ChasmEngine) predicateSatisfied(
353353
ctx context.Context,
354+
predicate func(chasm.Context, chasm.Component) (bool, error),
354355
ref chasm.ComponentRef,
355356
executionLease api.WorkflowLease,
356-
predicateFn func(chasm.Context, chasm.Component) (bool, error),
357357
) ([]byte, error) {
358358
chasmTree, ok := executionLease.GetMutableState().ChasmTree().(*chasm.Node)
359359
if !ok {
@@ -382,7 +382,7 @@ func (e *ChasmEngine) predicateSatisfied(
382382
if err != nil {
383383
return nil, err
384384
}
385-
satisfied, err := predicateFn(chasmContext, component)
385+
satisfied, err := predicate(chasmContext, component)
386386
if err != nil {
387387
return nil, err
388388
}

0 commit comments

Comments
 (0)