Generates an expoential backoff series of values
Returns a Continuously that continually executes callback
at interval
rate.
Creates an instance of a Pool
Returns a debounce function which acts to filter calls to a given function fn
.
Pauses execution for interval after which the asynchronous callback
is executed and awaited.
Must be called with await
if you want the pause effect.
Async generator that loops at a given interval.
A timer that uses clock time. Start time is from the point of invocation.
A timer that progresses with each call to elapsed
.
Subscribes to events on target
, returning the event data
from the first event that fires.
Returns true for every _n_th call, eg 2 for every second call.
A timer based on frequency: cycles per unit of time. These timers return a number from 0..1 indicating position with a cycle.
A function that returns true when an interval has elapsed
Uses the same algorithm as movingAverageLight, but adds values automatically if nothing has been manually added.
Returns a function that returns the percentage of timer completion. Starts when return function is first invoked.
Returns a function that returns the percentage (0..1) of timer completion. Uses 'ticks' as a measure. Use ofTotal if you want time-based.
Creates a new Promise, returning the promise along with its resolve and reject functions.
Ensures that whatToCall
is executed with a given tempo.
Generates values from produce
with a time delay.
produce
can be a simple function that returns a value, an async function, or a generator.
If produce
returns undefined, generator exits.
Generates values from produce
with a time delay.
produce
can be a simple function that returns a value, an function, or a generator.
If produce
returns undefined, generator exits.
Keeps calling callback
until it returns something other than undefined.
There is an exponentially-increasing delay between each retry attempt.
Keeps trying to run task
.
Runs a series of async expressions, returning the results. Use runSingle if it's only a single result you care about.
Runs a function once
Like run, but it returns a single result or undefined.
Use the at
option to specify which index of results to use.
By default it's -1, which is the presumably the highest-ranked result.
Queue of a single item, only once, allows for simple synchronisation.
Returns after timeout period.
Throttles a function. Callback only allowed to run after minimum of intervalMinMs
.
Returns a Timeout that can be triggered, cancelled and reset. Use continuously for interval- based loops.
Returns a ModulationTimer that is always at 100%. Opposite: timerNeverDone.
Returns a ModulationTimer that is always at 0%. Opposite: timerAlwaysDone.
Wraps timer
, computing a value based on its elapsed value.
fn
creates this value.
Calls the async fn
to generate a value if there is no prior value or
interval
has elapsed since value was last generated.
Helper function for calling code that should fail after a timeout. In short, it allows you to signal when the function succeeded, to cancel it, or to be notified if it was canceled or completes.
Maintains a list of listeners to receive data
Resource pool It does the housekeeping of managing a limited set of resources which are shared by 'users'. All resources in the Pool are meant to be the same kind of object.
A use of a pool resource
Matches responses with requests, expiring requests if they do not get a response in a timely manner.
A resource allocated in the Pool
Simple synchronisation. Supports only a single signal/waiter. Expects one or more calls to .signal() for .forSignal() to resolve
Simple task queue. Each task is awaited and run in turn.
Queue of a single item, only once, allows for simple synchronisation.
Node can have conditions as to whether they should even be considered Conditions can have dependencies on values, ideally this is responsive Conditions might abort sibling nodes, as in example: https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/ArtificialIntelligence/BehaviorTrees/BehaviorTreesOverview/
A Timer that has a sense of completion, when isDone
returns true.
See relative
Runs a function continuously, returned by continuously
Options for continuously
Debounced function
Delay options
Policy for when the pool is fully used
Pool options
State of pool
Options for relative timer
Options for repeat
Backoff options
Result of backoff
A resettable timeout, returned by timeout
A timer instance. CompletionTimer also contains an 'isDone' field.
Creates a timer
Functions for creating and driving a state machine