mirror of
https://github.com/temporalio/temporal.git
synced 2026-08-30 18:41:49 -07:00
Rename SideEffectTaskExecutor to SideEffectTaskHandler and PureTaskExecutor to PureTaskHandler across the CHASM framework and all library implementations (activity, callback, nexusoperation, scheduler). Merge the separate SideEffectTaskDiscarder interface into SideEffectTaskHandler as a required Discard method. Introduce SideEffectTaskHandlerBase[T] which provides a default Discard returning ErrTaskDiscarded, and PureTaskHandlerBase with an unexported marker method — both must be embedded by implementations. This eliminates HasDiscardHandler() from RegistrableTask and the conditional nil check in ExecuteSideEffectDiscardTask, replacing it with eager validation that rejects pure tasks at the call site. The discard function is now always present on side-effect tasks, simplifying the standby task execution path. Also rename executor source files to tasks files in the callback and nexusoperation packages and update receiver names from `e` to `h` throughout. ## Why? - The split interfaces required duplicate registration but in practice both interfaces were implemented by a single struct. - A base implementation is great for future proofing when more optional methods are added.
26 lines
553 B
Go
26 lines
553 B
Go
package nexusoperation
|
|
|
|
import (
|
|
"go.temporal.io/server/chasm"
|
|
"go.uber.org/fx"
|
|
)
|
|
|
|
var Module = fx.Module(
|
|
"chasm.lib.nexusoperations",
|
|
fx.Provide(configProvider),
|
|
fx.Provide(NewOperationInvocationTaskHandler),
|
|
fx.Provide(NewOperationBackoffTaskHandler),
|
|
fx.Provide(NewOperationTimeoutTaskHandler),
|
|
fx.Provide(NewCancellationTaskHandler),
|
|
fx.Provide(NewCancellationBackoffTaskHandler),
|
|
fx.Provide(newLibrary),
|
|
fx.Invoke(register),
|
|
)
|
|
|
|
func register(
|
|
registry *chasm.Registry,
|
|
library *Library,
|
|
) error {
|
|
return registry.Register(library)
|
|
}
|