taskupdate

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package taskupdate provides types and utilities for performing a2a.Task updates in response to a2a.Event-s.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFinal added in v0.3.3

func IsFinal(event a2a.Event) bool

IsFinal returns true if event must terminate a valid execution event sequence.

Types

type Manager

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

Manager is used for processing a2a.Event related to an a2a.Task. It updates the Task accordingly and uses Saver to store the new state.

func NewManager

func NewManager(saver Saver, task *VersionedTask) *Manager

NewManager is a Manager constructor function.

func (*Manager) Process

func (mgr *Manager) Process(ctx context.Context, event a2a.Event) (*VersionedTask, error)

Process validates the event associated with the managed a2a.Task and integrates the new state into it.

func (*Manager) SetTaskFailed

func (mgr *Manager) SetTaskFailed(ctx context.Context, event a2a.Event, cause error) (*VersionedTask, error)

SetTaskFailed attempts to move the Task to failed state and returns it in case of a success.

type Saver

type Saver interface {
	Save(ctx context.Context, task *a2a.Task, event a2a.Event, prev a2a.TaskVersion) (a2a.TaskVersion, error)
}

Saver is used for saving the a2a.Task after updating its state.

type VersionedTask added in v0.3.4

type VersionedTask struct {
	Task    *a2a.Task
	Version a2a.TaskVersion
}

Jump to

Keyboard shortcuts

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