Skip to content

Commit 8ae49db

Browse files
committed
Standalone Nexus Operations API (#9458)
Add API boilerplate for standalone Nexus Operations. - [x] built - [ ] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s)
1 parent 724366e commit 8ae49db

17 files changed

Lines changed: 671 additions & 23 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package nexusoperation
2+
3+
import (
4+
"context"
5+
6+
"go.temporal.io/api/serviceerror"
7+
"go.temporal.io/api/workflowservice/v1"
8+
"go.temporal.io/server/common/log"
9+
"go.temporal.io/server/common/namespace"
10+
)
11+
12+
// FrontendHandler provides the frontend-facing API for standalone Nexus operations.
13+
type FrontendHandler interface {
14+
StartNexusOperationExecution(context.Context, *workflowservice.StartNexusOperationExecutionRequest) (*workflowservice.StartNexusOperationExecutionResponse, error)
15+
DescribeNexusOperationExecution(context.Context, *workflowservice.DescribeNexusOperationExecutionRequest) (*workflowservice.DescribeNexusOperationExecutionResponse, error)
16+
PollNexusOperationExecution(context.Context, *workflowservice.PollNexusOperationExecutionRequest) (*workflowservice.PollNexusOperationExecutionResponse, error)
17+
ListNexusOperationExecutions(context.Context, *workflowservice.ListNexusOperationExecutionsRequest) (*workflowservice.ListNexusOperationExecutionsResponse, error)
18+
CountNexusOperationExecutions(context.Context, *workflowservice.CountNexusOperationExecutionsRequest) (*workflowservice.CountNexusOperationExecutionsResponse, error)
19+
RequestCancelNexusOperationExecution(context.Context, *workflowservice.RequestCancelNexusOperationExecutionRequest) (*workflowservice.RequestCancelNexusOperationExecutionResponse, error)
20+
TerminateNexusOperationExecution(context.Context, *workflowservice.TerminateNexusOperationExecutionRequest) (*workflowservice.TerminateNexusOperationExecutionResponse, error)
21+
DeleteNexusOperationExecution(context.Context, *workflowservice.DeleteNexusOperationExecutionRequest) (*workflowservice.DeleteNexusOperationExecutionResponse, error)
22+
}
23+
24+
type frontendHandler struct {
25+
config *Config
26+
logger log.Logger
27+
namespaceRegistry namespace.Registry
28+
}
29+
30+
func NewFrontendHandler(
31+
config *Config,
32+
logger log.Logger,
33+
namespaceRegistry namespace.Registry,
34+
) FrontendHandler {
35+
return &frontendHandler{
36+
config: config,
37+
logger: logger,
38+
namespaceRegistry: namespaceRegistry,
39+
}
40+
}
41+
42+
func (h *frontendHandler) StartNexusOperationExecution(context.Context, *workflowservice.StartNexusOperationExecutionRequest) (*workflowservice.StartNexusOperationExecutionResponse, error) {
43+
return nil, serviceerror.NewUnimplemented("StartNexusOperationExecution not implemented")
44+
}
45+
46+
func (h *frontendHandler) DescribeNexusOperationExecution(context.Context, *workflowservice.DescribeNexusOperationExecutionRequest) (*workflowservice.DescribeNexusOperationExecutionResponse, error) {
47+
return nil, serviceerror.NewUnimplemented("DescribeNexusOperationExecution not implemented")
48+
}
49+
50+
func (h *frontendHandler) PollNexusOperationExecution(context.Context, *workflowservice.PollNexusOperationExecutionRequest) (*workflowservice.PollNexusOperationExecutionResponse, error) {
51+
return nil, serviceerror.NewUnimplemented("PollNexusOperationExecution not implemented")
52+
}
53+
54+
func (h *frontendHandler) ListNexusOperationExecutions(context.Context, *workflowservice.ListNexusOperationExecutionsRequest) (*workflowservice.ListNexusOperationExecutionsResponse, error) {
55+
return nil, serviceerror.NewUnimplemented("ListNexusOperationExecutions not implemented")
56+
}
57+
58+
func (h *frontendHandler) CountNexusOperationExecutions(context.Context, *workflowservice.CountNexusOperationExecutionsRequest) (*workflowservice.CountNexusOperationExecutionsResponse, error) {
59+
return nil, serviceerror.NewUnimplemented("CountNexusOperationExecutions not implemented")
60+
}
61+
62+
func (h *frontendHandler) RequestCancelNexusOperationExecution(context.Context, *workflowservice.RequestCancelNexusOperationExecutionRequest) (*workflowservice.RequestCancelNexusOperationExecutionResponse, error) {
63+
return nil, serviceerror.NewUnimplemented("RequestCancelNexusOperationExecution not implemented")
64+
}
65+
66+
func (h *frontendHandler) TerminateNexusOperationExecution(context.Context, *workflowservice.TerminateNexusOperationExecutionRequest) (*workflowservice.TerminateNexusOperationExecutionResponse, error) {
67+
return nil, serviceerror.NewUnimplemented("TerminateNexusOperationExecution not implemented")
68+
}
69+
70+
func (h *frontendHandler) DeleteNexusOperationExecution(context.Context, *workflowservice.DeleteNexusOperationExecutionRequest) (*workflowservice.DeleteNexusOperationExecutionResponse, error) {
71+
return nil, serviceerror.NewUnimplemented("DeleteNexusOperationExecution not implemented")
72+
}

chasm/lib/nexusoperation/fx.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
)
77

88
var Module = fx.Module(
9-
"chasm.lib.nexusoperations",
9+
"chasm.lib.nexusoperation",
1010
fx.Provide(configProvider),
1111
fx.Provide(NewOperationInvocationTaskExecutor),
1212
fx.Provide(NewOperationBackoffTaskExecutor),
@@ -20,6 +20,11 @@ var Module = fx.Module(
2020
fx.Invoke(registerCommandHandlers),
2121
)
2222

23+
var FrontendModule = fx.Module(
24+
"chasm.lib.nexusoperation.frontend",
25+
fx.Provide(NewFrontendHandler),
26+
)
27+
2328
func register(
2429
registry *chasm.Registry,
2530
library *Library,

client/frontend/client_gen.go

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/frontend/metric_client_gen.go

Lines changed: 112 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)