Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeGlobalTemporalService ¶ added in v1.0.30
func InitializeGlobalTemporalService(client client.TemporalClient, workerManager worker.TemporalWorkerManager, logger *logger.Logger)
InitializeGlobalTemporalService initializes the global Temporal service instance
Types ¶
type TemporalService ¶
type TemporalService interface {
// Core operations
Start(ctx context.Context) error
Stop(ctx context.Context) error
IsHealthy(ctx context.Context) bool
// Workflow operations
StartWorkflow(ctx context.Context, options models.StartWorkflowOptions, workflow types.TemporalWorkflowType, args ...interface{}) (models.WorkflowRun, error)
SignalWorkflow(ctx context.Context, workflowID, runID, signalName string, arg interface{}) error
QueryWorkflow(ctx context.Context, workflowID, runID, queryType string, args ...interface{}) (interface{}, error)
CancelWorkflow(ctx context.Context, workflowID, runID string) error
TerminateWorkflow(ctx context.Context, workflowID, runID, reason string, details ...interface{}) error
// Activity operations
CompleteActivity(ctx context.Context, taskToken []byte, result interface{}, err error) error
RecordActivityHeartbeat(ctx context.Context, taskToken []byte, details ...interface{}) error
// Worker operations
RegisterWorkflow(taskQueue types.TemporalTaskQueue, workflow interface{}) error
RegisterActivity(taskQueue types.TemporalTaskQueue, activity interface{}) error
StartWorker(taskQueue types.TemporalTaskQueue) error
StopWorker(taskQueue types.TemporalTaskQueue) error
StopAllWorkers() error
// Utility operations
GetWorkflowHistory(ctx context.Context, workflowID, runID string) (interface{}, error)
DescribeWorkflowExecution(ctx context.Context, workflowID, runID string) (interface{}, error)
// Unified workflow execution - handles everything internally
ExecuteWorkflow(ctx context.Context, workflowType types.TemporalWorkflowType, params interface{}) (models.WorkflowRun, error)
// Synchronous workflow execution - waits for workflow completion and returns result
ExecuteWorkflowSync(ctx context.Context, workflowType types.TemporalWorkflowType, params interface{}, timeout int) (interface{}, error)
}
TemporalService is the main entry point for temporal operations
func GetGlobalTemporalService ¶ added in v1.0.30
func GetGlobalTemporalService() TemporalService
GetGlobalTemporalService returns the global Temporal service instance
func NewTemporalService ¶
func NewTemporalService(client client.TemporalClient, workerManager worker.TemporalWorkerManager, logger *logger.Logger) TemporalService
NewTemporalService creates a new temporal service instance
Click to show internal directories.
Click to hide internal directories.