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).
38 lines
1.1 KiB
Go
38 lines
1.1 KiB
Go
package workflow
|
|
|
|
import (
|
|
"go.temporal.io/api/serviceerror"
|
|
"github.com/hanzoai/tasks/service/history/hsm"
|
|
)
|
|
|
|
// TransactionPolicy indicates whether a mutable state transaction is happening for an active namespace or passive namespace.
|
|
|
|
const (
|
|
// Mutable state is a top-level state machine in the state machines framework.
|
|
StateMachineType = "workflow.MutableState"
|
|
)
|
|
|
|
type stateMachineDefinition struct{}
|
|
|
|
// TODO: Remove this implementation once transition history is fully implemented.
|
|
func (s stateMachineDefinition) CompareState(any, any) (int, error) {
|
|
return 0, serviceerror.NewUnimplemented("CompareState not implemented for workflow mutable state")
|
|
}
|
|
|
|
func (stateMachineDefinition) Deserialize([]byte) (any, error) {
|
|
return nil, serviceerror.NewUnimplemented("workflow mutable state persistence is not supported in the HSM framework")
|
|
}
|
|
|
|
// Serialize is a noop as Deserialize is not supported.
|
|
func (stateMachineDefinition) Serialize(any) ([]byte, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
func (stateMachineDefinition) Type() string {
|
|
return StateMachineType
|
|
}
|
|
|
|
func RegisterStateMachine(reg *hsm.Registry) error {
|
|
return reg.RegisterMachine(stateMachineDefinition{})
|
|
}
|