Help us shape the future of Go! Take the 2026 Go Developer Survey

reference

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package reference supplies an optional durable state implementation. It is not a scheduler; native hosts may implement tasks.Backend directly instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Clock          func() time.Time
	ID             func() (string, error)
	DefaultTTLMS   *int64
	PollIntervalMS int64
	// ValidateInput is pure schema/policy validation, never a dispatch callback.
	ValidateInput func(context.Context, tasks.Record, string, tasks.InputRequest, json.RawMessage) error
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(store tasks.Store, options Options) (*Service, error)

func (*Service) Cancel

func (s *Service) Cancel(ctx context.Context, owner tasks.Owner, id string) (tasks.Acknowledgement, error)

func (*Service) Complete

func (s *Service) Complete(ctx context.Context, owner tasks.Owner, id string, result json.RawMessage) error

func (*Service) Create

func (*Service) Fail

func (s *Service) Fail(ctx context.Context, owner tasks.Owner, id string, rpcError *tasks.RPCError) error

func (*Service) Get

func (s *Service) Get(ctx context.Context, owner tasks.Owner, id string) (tasks.GetTaskResult, error)

func (*Service) MarkCancelled

func (s *Service) MarkCancelled(ctx context.Context, owner tasks.Owner, id string) error

MarkCancelled is called only after the existing executor confirms cancellation.

func (*Service) Notification

func (s *Service) Notification(ctx context.Context, owner tasks.Owner, id string) (tasks.TaskStatusNotification, error)

func (*Service) PrivateRecord

func (s *Service) PrivateRecord(ctx context.Context, owner tasks.Owner, id string) (tasks.Record, error)

PrivateRecord gives a trusted adapter its durable input/cancel/origin state.

func (*Service) RequireInput

func (s *Service) RequireInput(ctx context.Context, owner tasks.Owner, id string, requests tasks.InputRequests) error

func (*Service) SetMetadata

func (s *Service) SetMetadata(ctx context.Context, owner tasks.Owner, id, message string, ttl, pollInterval *int64) error

func (*Service) Update

func (s *Service) Update(ctx context.Context, owner tasks.Owner, id string, responses tasks.InputResponses) (tasks.Acknowledgement, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL