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).
99 lines
2.3 KiB
Go
99 lines
2.3 KiB
Go
package workflow
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"go.temporal.io/api/serviceerror"
|
|
persistencespb "github.com/hanzoai/tasks/api/persistence/v1"
|
|
"github.com/hanzoai/tasks/chasm"
|
|
historyi "github.com/hanzoai/tasks/service/history/interfaces"
|
|
"github.com/hanzoai/tasks/service/history/tasks"
|
|
)
|
|
|
|
var _ historyi.ChasmTree = (*noopChasmTree)(nil)
|
|
|
|
var NoopChasmTree = &noopChasmTree{}
|
|
|
|
type noopChasmTree struct{}
|
|
|
|
func (*noopChasmTree) CloseTransaction() (chasm.NodesMutation, error) {
|
|
return chasm.NodesMutation{}, nil
|
|
}
|
|
|
|
func (*noopChasmTree) Snapshot(*persistencespb.VersionedTransition) chasm.NodesSnapshot {
|
|
return chasm.NodesSnapshot{}
|
|
}
|
|
|
|
func (*noopChasmTree) ApplySystemMutation(chasm.NodesMutation) error {
|
|
return nil
|
|
}
|
|
|
|
func (*noopChasmTree) ApplyMutation(chasm.NodesMutation) error {
|
|
return nil
|
|
}
|
|
|
|
func (*noopChasmTree) ApplySnapshot(chasm.NodesSnapshot) error {
|
|
return nil
|
|
}
|
|
|
|
func (*noopChasmTree) RefreshTasks() error {
|
|
return nil
|
|
}
|
|
|
|
func (*noopChasmTree) IsStateDirty() bool {
|
|
return false
|
|
}
|
|
|
|
func (*noopChasmTree) IsDirty() bool {
|
|
return false
|
|
}
|
|
|
|
func (*noopChasmTree) Terminate(chasm.TerminateComponentRequest) error {
|
|
return nil
|
|
}
|
|
|
|
func (*noopChasmTree) Archetype() (chasm.Archetype, error) {
|
|
return chasm.WorkflowArchetype, nil
|
|
}
|
|
|
|
func (*noopChasmTree) ArchetypeID() chasm.ArchetypeID {
|
|
return chasm.WorkflowArchetypeID
|
|
}
|
|
|
|
func (*noopChasmTree) EachPureTask(
|
|
deadline time.Time,
|
|
callback func(executor chasm.NodePureTask, taskAttributes chasm.TaskAttributes, task any) (bool, error),
|
|
) error {
|
|
return nil
|
|
}
|
|
|
|
func (*noopChasmTree) IsStale(chasm.ComponentRef) error {
|
|
return nil
|
|
}
|
|
|
|
func (*noopChasmTree) Component(chasm.Context, chasm.ComponentRef) (chasm.Component, error) {
|
|
return nil, serviceerror.NewInternal("Component() method invoked on noop CHASM tree")
|
|
}
|
|
|
|
func (*noopChasmTree) ComponentByPath(chasm.Context, []string) (chasm.Component, error) {
|
|
return nil, serviceerror.NewInternal("ComponentByPath() method invoked on noop CHASM tree")
|
|
}
|
|
|
|
func (*noopChasmTree) ExecuteSideEffectTask(
|
|
ctx context.Context,
|
|
registry *chasm.Registry,
|
|
executionKey chasm.ExecutionKey,
|
|
task *tasks.ChasmTask,
|
|
validate func(chasm.NodeBackend, chasm.Context, chasm.Component) error,
|
|
) error {
|
|
return nil
|
|
}
|
|
|
|
func (*noopChasmTree) ValidateSideEffectTask(
|
|
ctx context.Context,
|
|
task *tasks.ChasmTask,
|
|
) (bool, error) {
|
|
return false, nil
|
|
}
|