Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
29c7af3
feat: nexus integration
xepozz Apr 16, 2026
a355cb4
Merge branch 'master' into nexus
xepozz May 3, 2026
ac23aac
feat: add NexusStartedRegistry and callback integration for Nexus ope…
xepozz May 4, 2026
0db51d1
refactor: unify NexusStartedRegistry and IDRegistry using generic Reg…
xepozz May 4, 2026
47617b2
refactor: consolidate NexusHandler initialization and update Registry…
xepozz May 4, 2026
31587b7
refactor: simplify Nexus service registration and method cancellation…
xepozz May 5, 2026
7ffaaea
refactor: remove methodCancelSupported flag and streamline Nexus serv…
xepozz May 5, 2026
b8df3fd
Merge branch 'refs/heads/master' into nexus
xepozz May 5, 2026
7fd6d1b
refactor: simplify NexusHandler and clean up unused methods
xepozz May 5, 2026
a280912
chore: update go version and dependencies in go.work and go.work.sum
xepozz May 6, 2026
c00f149
feat: add NexusServices support and retrieval in temporal
xepozz May 6, 2026
9df1062
feat: add discard functionality to registry and metadata stripping in…
xepozz May 7, 2026
61b534a
feat: add NexusOperationStarted command and decoding tests
xepozz May 7, 2026
56ab2cc
refactor: simplify NexusHandler reply decoding and link processing
xepozz May 7, 2026
061d700
refactor: remove unused testing files for aggregatedpool module
xepozz May 7, 2026
2dc213a
refactor: move Nexus-related tests to protocol_test for cleanup and m…
xepozz May 7, 2026
9c244c5
refactor: improve failure handling in Nexus errors and cleanup unused…
xepozz May 25, 2026
eddab43
feat(nexus): propagate namespace/taskQueue/headers and decode cancel …
xepozz Jul 13, 2026
b33a08a
Merge origin/master into nexus
xepozz Jul 13, 2026
73828f6
fix(nexus): guard registration, fix started-registry hang, tidy up
xepozz Jul 13, 2026
a38eb0d
docs(nexus): trim verbose comments across protocol + tests
xepozz Jul 13, 2026
ca220fd
Merge remote-tracking branch 'origin/master' into nexus
xepozz Aug 18, 2026
de67178
style(nexus): satisfy golangci-lint (errors.As, exhaustive switch, sp…
xepozz Aug 18, 2026
12f047e
test(env): enable ListWorkers and worker heartbeats via dynamic config
xepozz Aug 18, 2026
e88b635
fix(workflow): flush responses queued by synchronous callbacks
xepozz Aug 18, 2026
f01ed84
feat(nexus): read the canonical operation error shapes from PHP
xepozz Aug 19, 2026
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
53 changes: 47 additions & 6 deletions aggregatedpool/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,14 @@ func (wp *Workflow) handleMessage(msg *internal.Message) error {
timerID := wp.env.NewTimer(command.ToDuration(), workflow.TimerOptions{
Summary: command.Summary,
}, wp.createCallback(msg.ID, "NewTimer"))
// A non-positive duration is resolved by the SDK inside NewTimer: the callback
// already ran, no timer exists, nothing to cancel.
if timerID == nil {
break
}
wp.canceller.Register(msg.ID, func() error {
if timerID != nil {
wp.log.Debug("cancel timer request", zap.String("timerID", timerID.String()))
wp.env.RequestCancelTimer(*timerID)
}
wp.log.Debug("cancel timer request", zap.String("timerID", timerID.String()))
wp.env.RequestCancelTimer(*timerID)
return nil
})

Expand Down Expand Up @@ -530,6 +533,44 @@ func (wp *Workflow) handleMessage(msg *internal.Message) error {
return errors.E(op, err)
}

case *internal.ExecuteNexusOperation:
wp.log.Debug("nexus operation request",
zap.Uint64("ID", msg.ID),
zap.String("endpoint", command.Endpoint),
zap.String("service", command.Service),
zap.String("operation", command.Operation),
)

params := command.NexusOperationParams(msg.Payloads, msg.Header)

nexusSeq := wp.env.ExecuteNexusOperation(
params,
wp.makeNexusCompletionResponseCallback(msg.ID),
wp.makeNexusStartedRegistryCallback(msg.ID),
)

wp.canceller.Register(msg.ID, func() error {
wp.log.Debug("cancel nexus operation request", zap.Int64("seq", nexusSeq))
wp.env.RequestCancelNexusOperation(nexusSeq)
return nil
})

case *internal.GetNexusOperationStarted:
wp.log.Debug("get nexus operation started", zap.Uint64("ID", msg.ID), zap.Uint64("startID", command.ID))

// Drop the slot on consume, not on completion: a fast op can complete
// before PHP asks, and discarding early would hang this Listen forever.
wp.nexusStarted.Listen(command.ID, func(token string, err error) {
defer wp.nexusStarted.Discard(command.ID)
// May fire inline when the token was already pushed.
wp.pendingFlush = true
if err != nil {
wp.mq.PushError(msg.ID, temporal.GetDefaultFailureConverter().ErrorToFailure(err), wp.getWorkflowWorkerPid())
return
}
wp.pushStartEnvelope(msg.ID, NexusStartEnvelope{Async: token != "", Token: token})
})

default:
return errors.E(op, errors.Str("undefined command"))
}
Expand All @@ -554,7 +595,7 @@ func (wp *Workflow) createLocalActivityCallback(id uint64) bindings.LocalActivit

return func(lar *bindings.LocalActivityResultWrapper) {
// timer cancel callback can happen inside the loop
if atomic.LoadUint32(&wp.inLoop) == 1 {
if wp.deliverInline() {
wp.log.Debug("calling local activity callback IN LOOP", zap.Uint64("ID", id))
callback(lar)
return
Expand Down Expand Up @@ -586,7 +627,7 @@ func (wp *Workflow) createCallback(id uint64, t string) bindings.ResultHandler {

return func(result *commonpb.Payloads, err error) {
// timer cancel callback can happen inside the loop
if atomic.LoadUint32(&wp.inLoop) == 1 {
if wp.deliverInline() {
wp.log.Debug("calling callback IN LOOP", zap.Uint64("ID", id), zap.String("type", t))
callback(result, err)
return
Expand Down
Loading
Loading