@@ -22,17 +22,16 @@ public class InternalNexusOperationContext {
2222 // workflow client (signal, signalWithStart) can attach them to outgoing requests via
2323 // SignalWorkflowExecutionRequest.links.
2424 private List <Link > nexusOperationLinks = Collections .emptyList ();
25- // Backlinks returned by SignalWorkflowExecutionResponse.link /
26- // SignalWithStartWorkflowExecutionResponse.signal_link. One entry per signal RPC issued from
27- // within the Nexus operation handler. Drained by the task handler when building
28- // StartOperationResponse so every signal the handler issues gets a corresponding link on the
29- // caller workflow's history event.
25+ // Backlinks returned by outbound RPCs the operation handler issues (currently
26+ // SignalWorkflowExecutionResponse.link and SignalWithStartWorkflowExecutionResponse.signal_link;
27+ // future update/start variants attach the same way). One entry per outbound RPC that returned
28+ // a link. Drained by the task handler when building StartOperationResponse so each RPC the
29+ // handler issued gets a corresponding link on the caller workflow's history event.
3030 //
3131 // NOTE: this context is only safe for use from the single thread that runs the operation
3232 // handler (the Nexus task executor's thread). Handlers that spawn their own threads to issue
33- // signals will not see the thread-local context, so the links from those signals will not
34- // propagate.
35- private final List <Link > signalWorkflowResponseLinks = new ArrayList <>();
33+ // RPCs will not see the thread-local context, so the links from those RPCs will not propagate.
34+ private final List <Link > responseBacklinks = new ArrayList <>();
3635
3736 public InternalNexusOperationContext (
3837 String namespace ,
@@ -88,7 +87,7 @@ public Link getStartWorkflowResponseLink() {
8887
8988 /**
9089 * Set the {@code common.v1.Link}s extracted from the inbound Nexus task so they can be attached
91- * to any signal RPCs issued by the operation handler.
90+ * to RPCs issued by the operation handler.
9291 */
9392 public void setNexusOperationLinks (List <Link > links ) {
9493 this .nexusOperationLinks = links == null ? Collections .emptyList () : links ;
@@ -100,19 +99,19 @@ public List<Link> getNexusOperationLinks() {
10099 }
101100
102101 /**
103- * Append a backlink returned by a signal-class RPC (signal or signalWithStart). Each signal the
104- * operation handler issues should add one entry; the task handler drains the list when building
105- * the operation's StartOperationResponse.
102+ * Append a backlink returned by an outbound RPC the operation handler issued (e.g. signal,
103+ * signalWithStart, and future update/start variants). The task handler drains the list when
104+ * building the operation's StartOperationResponse.
106105 */
107- public void addSignalWorkflowResponseLink (Link link ) {
106+ public void addBacklink (Link link ) {
108107 if (link != null ) {
109- this .signalWorkflowResponseLinks .add (link );
108+ this .responseBacklinks .add (link );
110109 }
111110 }
112111
113- /** Backlinks from every signal RPC issued by the handler. Never null; may be empty. */
114- public List <Link > getSignalWorkflowResponseLinks () {
115- return signalWorkflowResponseLinks ;
112+ /** Backlinks from every outbound RPC the handler issued . Never null; may be empty. */
113+ public List <Link > getBacklinks () {
114+ return responseBacklinks ;
116115 }
117116
118117 private class NexusOperationContextImpl implements NexusOperationContext {
0 commit comments