package
3.3.0+incompatible
Repository: https://github.com/google/agi.git
Documentation: pkg.go.dev

# Functions

Async runs the task t on a new go-routine, retuning a function that cancels the task's context, and blocks until the task completes.
Batch returns an executor that uses the supplied executor to run tasks, and automatically adds the completion signals for those tasks to the supplied Signals list.
CachedExecutorFactory builds an ExecutorFactory that makes new executors on demand using the underlying factory.
Delay wraps a task in a coroutine to asynchronously execute after a specified duration.
Direct is a synchronous implementation of an Executor that runs the task before returning.
Go is an asynchronous implementation of an Executor that starts a new go routine to run the task.
IgnoreCancellation returns a context that will pretend to never be canceled.
NewBaton returns a new Baton, with the expectation that the calling goroutine owns the baton.
NewSignal builds a new signal, and then returns the signal and a Task that is used to fire the signal.
Once wraps a task so that only the first invocation of the outer task invokes the inner task.
Poll blocks, calling f at regular intervals of i until the context is cancelled or f returns an error.
Pool returns a new Executor that uses a pool of goroutines to run the tasks, and a Task that shuts down the pool.
PoolExecutorFactory builds an ExecutorFactory that makes a new Pool executor each time it is invoked.
Prepare is used to build a new Signal,Runner pair for a Task.
Retry repeatedly calls f until f returns a true, the number of attempts reaches maxAttempts or the context is cancelled.
ShouldStop returns a chan that's closed when work done on behalf of this context should be stopped.
Stopped is shorthand for StopReason(ctx) != nil because it increases the readability of common use cases.
StopReason returns a non-nil error value after Done is closed.
WithCancel returns a copy of ctx with a new Done channel.
WithDeadline returns a copy of ctx with the deadline adjusted to be no later than deadline.
WithTimeout is shorthand for ctx.WithDeadline(time.Now().Add(duration)).

# Variables

FiredSignal is a signal that is always in the fired state.

# Structs

Events is a thread safe list of Event entries.
Handle is a reference to a running task submitted to an executor.

# Interfaces

Event is the interface to things that can be used to wait for conditions to occur.

# Type aliases

CancelFunc is a function type that can be used to stop a context.
Executor is the signature for a function that executes a Task.
ExecutorFactory returns an executor for the specified channel id, and a Task to shut the executor down again.
Runner is the type for a task that has been prepared to run by an executor.
Task is the unit of work used in the task system.