Files
temporal/chasm/lib/scheduler/fx.go
Roey Berman b781c57a13 Rename task Executor interfaces to Handler and unify discard into SideEffectTaskHandler (#9655)
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.
2026-03-25 15:42:28 -07:00

33 lines
869 B
Go

package scheduler
import (
"go.temporal.io/server/chasm"
legacyscheduler "go.temporal.io/server/service/worker/scheduler"
"go.uber.org/fx"
)
func Register(
registry *chasm.Registry,
library *Library,
) error {
return registry.Register(library)
}
var Module = fx.Module(
"chasm.lib.scheduler",
fx.Provide(ConfigProvider),
fx.Provide(legacyscheduler.NewSpecBuilder),
fx.Provide(NewSpecProcessor),
fx.Provide(func(impl *SpecProcessorImpl) SpecProcessor { return impl }),
fx.Provide(newHandler),
fx.Provide(NewSchedulerIdleTaskHandler),
fx.Provide(NewSchedulerCallbacksTaskHandler),
fx.Provide(NewGeneratorTaskHandler),
fx.Provide(NewInvokerExecuteTaskHandler),
fx.Provide(NewInvokerProcessBufferTaskHandler),
fx.Provide(NewBackfillerTaskHandler),
fx.Provide(NewSchedulerMigrateToWorkflowTaskHandler),
fx.Provide(NewLibrary),
fx.Invoke(Register),
)