package
1.0.1
Repository: https://github.com/apus-run/van.git
Documentation: pkg.go.dev

# Functions

AfterFunc is like time.AfterFunc, but also accepts a Waitable, and ensures that the AfterFunc is canceled if the waitable expires first.
All returns a waitable that is triggered once all the given waitables have been triggered at least once.
Any returns a waitable that is triggered once any of the given waitables is triggered.
AsContext returns a wrapper object that makes the given waitable appear like a context without values.
AsErrorWaitable wraps a given waitable into an error waitable.
CancelContextOnSignal cancels the given context (by invoking it's cancellation function) if the given signal is triggered.
CheckError returns true as the second return value if the given ErrorWaitable was in the triggered state, along with the respective error (which might be nil).
Deadline returns a waitable that is done after the given deadline.
DeadlineOr returns a waitable that is triggered when the given deadline expires, unless cancelCond is triggered beforehand.
DependentContext creates a cancellable context that is a child of parent context, and will be cancelled if the given signal is triggered.
Do performs the action as soon as the waitable is done.
DoWithTimeout performs the action as soon as the waitable is done.
ErrorC returns a channel that can be used to receive the error from the given error waitable.
ErrorNow returns an `ErrorWaitable` that is always triggered and returns the given error.
ErrorWithDefault returns the error of the given, triggered ErrorWaitable, or a `defaultErr` if the error is non-nil.
IsDone checks if the given waitable's condition is fulfilled.
Never satisfies the Waitable interface, but will never be signaled Waiting will block indefinitely.
NewErrorSignal creates and returns a new error signal.
NewPoller returns a poller that keeps checking the given condition at the specified interval.
NewSignal creates a new signal that is in the reset state.
NewStopper creates a new Stopper for arranging a graceful shutdown.
NewTurnstile returns a new instance of a Turnstile.
PollWithTimeout is a utility wrapper around Poller and WaitWithTimeout.
Timeout returns a waitable that is done after the given timeout.
TimeoutOr returns a waitable that gets triggered once the given timeout expires.
Wait waits indefinitely until the condition represented by the given Waitable is fulfilled.
WaitForAll waits until all the given waitables have been triggered at least once.
WaitForAny waits until any of the given waitables is triggered.
WaitForError unconditionally waits until the given error waitable is triggered, and returns its error, if any.
WaitForErrorInContext waits until the given ErrorWaitable is triggered, in which case the return value is the same as for CheckError.
WaitForErrorUntil waits until the given error waitable is triggered, in which case the return value is the same as for `CheckError(ew)`.
WaitForErrorWithDeadline is equivalent to `WaitForErrorWithTimeout(ew, time.Until(deadline))`.
WaitForErrorWithTimeout waits for the given ErrorWaitable and returns the error (equivalent to `CheckError(ew)`) once this happens.
WaitInContext waits for the given Waitable until a `parentContext` is done.
WaitWithDeadline waits for the given Waitable until a specified deadline.
WaitWithTimeout waits for the given Waitable with a specified timeout.

# Structs

ErrorSignal is a signal that supports atomically storing an error whenever it is triggered.
Flag is an atomic boolean flag.
A Poller keeps polling until a condition is met, and offers functionality similar to that provided in the Signal struct to wait for the condition to be met.
Signal implements a signalling facility.

# Interfaces

ErrorWaitable is a generic interface for things that can be waited upon, and might return an error upon completion.
ReadOnlyErrorSignal provides an interface to inspect ErrorSignals without modifying them.
Stopper encapsulates stop and stopped signals for arranging a graceful shutdown sequence for goroutines (and async processing in general).
StopperClient represents an interface for an external client (external to a stoppable goroutine) to request the stoppable goroutine to gracefully shutdown and to check the shutdown status.
StopperFlow represents an interface that should be used by a stoppable goroutine to check and report its status of a graceful shutdown.
StopperLowLevel is a lower level API for interacting with Stopper.
Turnstile is a concurrency primitive that is akin to a turnstile.
Waitable is a generic interface for things that can be waited upon.

# Type aliases

Error is an alias for the builtin `error` interface.