Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ec83286
Standalone Activity: initial protos, service routing, and boilerplate
bergundy Oct 16, 2025
00bfae3
Standalone activity post-rebase fixups (#8497)
dandavison Oct 16, 2025
5e31334
State machine for CHASM activities (#8496)
dandavison Oct 16, 2025
0f789f1
Added standalone activity start execution handlers. (#8501)
fretz12 Oct 18, 2025
41593fe
Consolidated and refactored activity request validations. (#8508)
fretz12 Oct 24, 2025
94812b3
Added standalone activity chasm dispatch task (#8540)
fretz12 Oct 30, 2025
7117c69
Update standalone activity protos (#8549)
dandavison Oct 30, 2025
d5aea67
Add timeout tasks for Standalone Activities (#8573)
fretz12 Nov 11, 2025
0e396f9
Added request ID transition option when creating activity entity. (#8…
fretz12 Nov 14, 2025
61ed927
PollComponent and PollActivityExecution (#8563)
dandavison Dec 5, 2025
e8d6ec2
Add standalone activity completion and failure support (#8653)
fretz12 Dec 5, 2025
9ada87b
Add support for standalone activity termination (#8665)
fretz12 Dec 5, 2025
bf79f38
Add support for standalone activity cancellation (#8688)
fretz12 Dec 5, 2025
a6d067a
Add handling of business ID policy for standalone activities (#8712)
fretz12 Dec 5, 2025
8d4d81c
Fix bug in CHASM activity schedule-to-close timer task validation (#8…
dandavison Dec 6, 2025
36ea888
Fix 2nd bug in CHASM activity schedule-to-close timer task validation…
dandavison Dec 6, 2025
7ce67bd
Post-merge changes to standalone-activity (#8770)
dandavison Dec 8, 2025
b448f78
Standalone Activity: DescribeActivityExecution and GetActivityExecuti…
dandavison Dec 8, 2025
5a1564e
Change dev environment to enable chasm (#8778)
fretz12 Dec 9, 2025
5a39da5
Standalone activity heartbeating (#8730)
dandavison Dec 11, 2025
7cfc41f
Add standalone activity metrics (#8759)
fretz12 Dec 12, 2025
846ec49
Add dynamic config to toggle standalone activity functionality (#8796)
fretz12 Dec 12, 2025
f2e4274
Standalone activity post merge fixups (#8831)
dandavison Dec 16, 2025
835220e
Add standalone activity terminate request ID handling (#8820)
fretz12 Dec 17, 2025
5575357
Add standalone heartbeat by ID (#8817)
fretz12 Dec 17, 2025
a4d5b49
Standalone Activity List and Count ActivityExecutions (#8789)
dandavison Dec 17, 2025
83dc5c2
Standalone activities to support for ID conflict use existing (#8814)
fretz12 Dec 17, 2025
0a30ee6
CHASM: bug fix: handle empty run ID in PollComponent (#8862)
dandavison Dec 18, 2025
7ad60d0
Standalone activity: clean up outcome computation (#8872)
dandavison Dec 18, 2025
dbe5f17
Filled remaining ActivityExecutionInfo fields (#8857)
fretz12 Dec 19, 2025
5fc0aae
Alias imports in activity.go (#8859)
fretz12 Dec 19, 2025
a224f56
Fix MySQL visibility GroupBy bug (#8879)
dandavison Dec 19, 2025
5852b15
Merge standalone-activity branch into main (#8875)
dandavison Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions api/historyservice/v1/request_response.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions api/matchingservice/v1/request_response.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions api/persistence/v1/tasks.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions api/token/v1/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions chasm/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Context interface {
// Intent() OperationIntent
// ComponentOptions(Component) []ComponentOption

structuredRef(Component) (ComponentRef, error)
getContext() context.Context
}

Expand Down Expand Up @@ -94,6 +95,10 @@ func (c *immutableCtx) Ref(component Component) ([]byte, error) {
return c.root.Ref(component)
}

func (c *immutableCtx) structuredRef(component Component) (ComponentRef, error) {
return c.root.structuredRef(component)
}

func (c *immutableCtx) Now(component Component) time.Time {
return c.root.Now(component)
}
Expand Down
4 changes: 4 additions & 0 deletions chasm/context_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func (c *MockContext) Ref(cmp Component) ([]byte, error) {
return nil, nil
}

func (c *MockContext) structuredRef(cmp Component) (ComponentRef, error) {
return ComponentRef{}, nil
}

func (c *MockContext) ExecutionKey() ExecutionKey {
if c.HandleExecutionKey != nil {
return c.HandleExecutionKey()
Expand Down
37 changes: 25 additions & 12 deletions chasm/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ type Engine interface {
PollComponent(
context.Context,
ComponentRef,
func(Context, Component) (any, bool, error),
func(MutableContext, Component, any) error,
func(Context, Component) (bool, error),
...TransitionOption,
) ([]byte, error)

// NotifyExecution notifies any PollComponent callers waiting on the execution.
NotifyExecution(ExecutionKey)
}

type BusinessIDReusePolicy int
Expand Down Expand Up @@ -178,6 +180,9 @@ func UpdateWithNewExecution[C Component, I any, O1 any, O2 any](
// - consider remove ComponentRef from the return value and allow components to get
// the ref in the transition function. There are some caveats there, check the
// comment of the NewRef method in MutableContext.
//
// UpdateComponent applies updateFn to the component identified by the supplied component reference.
// It returns the result, along with the new component reference. opts are currently ignored.
func UpdateComponent[C any, R []byte | ComponentRef, I any, O any](
ctx context.Context,
r R,
Expand Down Expand Up @@ -209,6 +214,8 @@ func UpdateComponent[C any, R []byte | ComponentRef, I any, O any](
return output, newSerializedRef, err
}

// ReadComponent returns the result of evaluating readFn against the component identified by the
// component reference. opts are currently ignored.
func ReadComponent[C any, R []byte | ComponentRef, I any, O any](
ctx context.Context,
r R,
Expand Down Expand Up @@ -236,11 +243,18 @@ func ReadComponent[C any, R []byte | ComponentRef, I any, O any](
return output, err
}

func PollComponent[C any, R []byte | ComponentRef, I any, O any, T any](
// PollComponent waits until the predicate is true when evaluated against the component identified
// by the supplied component reference. If this times out due to a server-imposed long-poll timeout
// then it returns (nil, nil, nil), as an indication that the caller should continue long-polling.
// Otherwise it returns (output, ref, err), where output is the output of the predicate function,
// and ref is a component reference identifying the state at which the predicate was satisfied. The
// predicate must be monotonic: if it returns true at execution state transition s then it must
// return true at all transitions t > s. If the predicate is true at the outset then PollComponent
// returns immediately. opts are currently ignored.
func PollComponent[C any, R []byte | ComponentRef, I any, O any](
ctx context.Context,
r R,
predicateFn func(C, Context, I) (T, bool, error),
operationFn func(C, MutableContext, I, T) (O, error),
monotonicPredicate func(C, Context, I) (O, bool, error),
input I,
opts ...TransitionOption,
) (O, []byte, error) {
Expand All @@ -254,13 +268,12 @@ func PollComponent[C any, R []byte | ComponentRef, I any, O any, T any](
newSerializedRef, err := engineFromContext(ctx).PollComponent(
ctx,
ref,
func(ctx Context, c Component) (any, bool, error) {
return predicateFn(c.(C), ctx, input)
},
func(ctx MutableContext, c Component, t any) error {
var err error
output, err = operationFn(c.(C), ctx, input, t.(T))
return err
func(ctx Context, c Component) (bool, error) {
out, satisfied, err := monotonicPredicate(c.(C), ctx, input)
if satisfied {
output = out
}
return satisfied, err
},
opts...,
)
Expand Down
22 changes: 17 additions & 5 deletions chasm/engine_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading