Skip to content

NEXUS-550: Nexus Operation Query support - #2508

Draft
mavemuri wants to merge 2 commits into
mainfrom
mavemuri/nexus-query
Draft

NEXUS-550: Nexus Operation Query support#2508
mavemuri wants to merge 2 commits into
mainfrom
mavemuri/nexus-query

Conversation

@mavemuri

Copy link
Copy Markdown
Contributor

What was changed

Adds support for QueryWorkflow as a Nexus operation

Why?

Part of effort to expose all Temporal primitives via Nexus operations

Checklist

  1. Closes NEXUS-550

  2. How was this tested:

  • added integration tests
  1. Any docs updates needed?
  • TBD

Comment thread temporalnexus/temporal_operation.go Outdated
// These are free functions because Go does not allow generic methods on non-generic structs.
//
// NOTE: Experimental
func StartQueryWorkflow[R any](

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We agreeded we would just use the regular clients query method, we don't need to add these

Comment thread internal/interceptor.go Outdated
// QueryRejectCondition is the query reject condition.
QueryRejectCondition enumspb.QueryRejectCondition
// gRPC request response trap for nexus forward links
responseInfo *queryWorkflowResponseInfo

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is overkill for queries , in the query handler we can just do something like what we did for signal eg:

	// If this signal was issued from inside a Nexus operation handler, capture the server's response
	// link (pointing at the WorkflowExecutionSignaled event) so the task handler can attach it to the
	// StartOperationResponse, linking the caller workflow's history event to the callee. Servers
	// without history.enableCHASMSignalBacklinks leave the link unset; AddResponseLink ignores
	// nil.
	if nctx, ok := NexusOperationContextFromGoContext(ctx); ok {
		nctx.AddResponseLink(response.GetLink())
	}

Comment thread temporalnexus/link_converter.go Outdated
// NOTE: Experimental
func ConvertWorkflowLinkToNexusLink(workflowLink *commonpb.Link_Workflow) nexus.Link {
return apinexus.ConvertWorkflowLinkToNexusLink(workflowLink)
// TODO: when bumping up api-go, also fix "ConvertWorkflowLinkToNexusLink" to use urlPathWorkflowTemplate

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a bug here we should fix it before updating the api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants