mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-03 03:56:04 +00:00
Full module path rebrand from Temporal to Hanzo Tasks: - go.mod module: github.com/hanzoai/tasks - All internal Go imports updated (1906 files) - cmd/server renamed to cmd/tasksd - Binary name: tasksd (was temporal-server) - Docker images: hanzoai/tasks (was temporalio/server) - README rewritten with Hanzo Tasks branding - LLM.md created with integration notes - Makefile, goreleaser, CI workflows updated - go.temporal.io/sdk and go.temporal.io/api imports preserved (separate repos) Fork of Temporal.io (MIT license).
55 lines
1001 B
Go
55 lines
1001 B
Go
package dummy
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/hanzoai/tasks/service/history/hsm"
|
|
)
|
|
|
|
func RegisterExecutor(
|
|
registry *hsm.Registry,
|
|
taskExecutorOptions TaskExecutorOptions,
|
|
) error {
|
|
activeExec := taskExecutor{
|
|
TaskExecutorOptions: taskExecutorOptions,
|
|
}
|
|
if err := hsm.RegisterImmediateExecutor(
|
|
registry,
|
|
activeExec.executeImmediateTask,
|
|
); err != nil {
|
|
return err
|
|
}
|
|
return hsm.RegisterTimerExecutor(
|
|
registry,
|
|
activeExec.executeTimerTask,
|
|
)
|
|
}
|
|
|
|
type (
|
|
TaskExecutorOptions struct {
|
|
ImmediateExecutor hsm.ImmediateExecutor[ImmediateTask]
|
|
TimerExecutor hsm.TimerExecutor[TimerTask]
|
|
}
|
|
|
|
taskExecutor struct {
|
|
TaskExecutorOptions
|
|
}
|
|
)
|
|
|
|
func (e taskExecutor) executeImmediateTask(
|
|
ctx context.Context,
|
|
env hsm.Environment,
|
|
ref hsm.Ref,
|
|
task ImmediateTask,
|
|
) error {
|
|
return e.ImmediateExecutor(ctx, env, ref, task)
|
|
}
|
|
|
|
func (e taskExecutor) executeTimerTask(
|
|
env hsm.Environment,
|
|
node *hsm.Node,
|
|
task TimerTask,
|
|
) error {
|
|
return e.TimerExecutor(env, node, task)
|
|
}
|