Documentation
¶
Index ¶
- Variables
- type Base
- func (b *Base[T]) Active() bool
- func (b *Base[T]) Err() error
- func (b *Base[T]) Send(ctx context.Context, value T) (*Promise[any], error)
- func (b *Base[T]) Shutdown(ctx context.Context) error
- func (b *Base[T]) TrySend(ctx context.Context, value T) (*Promise[any], bool)
- func (b *Base[T]) TryStart(ctx context.Context, callback func(context.Context, *Task[T]) error) bool
- type Message
- type Promise
- type Task
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrActorDead = errors.New("actor dead")
View Source
var ErrClosed = errors.New("promise closed")
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base[T any] struct { // contains filtered or unexported fields }
func (*Base[T]) Active ¶
Active returns true if the task is currently running. Note that by the time this function returns, the value it returns may already be stale.
func (*Base[T]) Shutdown ¶
Shutdown shuts down the task, if it's running. Shutdown will wait for the current instance of the task to fully shut down.
type Promise ¶
type Promise[T any] struct { // contains filtered or unexported fields }
Promise is a simple promise-like object.
func NewPromise ¶
Click to show internal directories.
Click to hide internal directories.