ixfx
    Preparing search index...

    Module @ixfx/flow - v0.44.1

    Namespaces

    StateMachine

    Functions for creating and driving a state machine

    Functions

    backoffGenerator

    Generates an expoential backoff series of values

    continuously

    Returns a Continuously that continually executes callback at interval rate.

    create

    Creates an instance of a Pool

    debounce

    Returns a debounce function which acts to filter calls to a given function fn.

    delay

    Pauses execution for interval after which the asynchronous callback is executed and awaited. Must be called with await if you want the pause effect.

    delayLoop

    Async generator that loops at a given interval.

    elapsedMillisecondsAbsolute

    A timer that uses clock time. Start time is from the point of invocation.

    elapsedTicksAbsolute

    A timer that progresses with each call to elapsed.

    eventRace

    Subscribes to events on target, returning the event data from the first event that fires.

    everyNth

    Returns true for every _n_th call, eg 2 for every second call.

    frequencyTimer

    A timer based on frequency: cycles per unit of time. These timers return a number from 0..1 indicating position with a cycle.

    hasElapsed

    A function that returns true when an interval has elapsed

    iterateBreadth
    iterateDepth
    movingAverageTimed

    Uses the same algorithm as movingAverageLight, but adds values automatically if nothing has been manually added.

    ofTotal

    Returns a function that returns the percentage of timer completion. Starts when return function is first invoked.

    ofTotalTicks

    Returns a function that returns the percentage (0..1) of timer completion. Uses 'ticks' as a measure. Use ofTotal if you want time-based.

    promiseWithResolvers

    Creates a new Promise, returning the promise along with its resolve and reject functions.

    rateMinimum

    Ensures that whatToCall is executed with a given tempo.

    repeat

    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.

    repeatSync

    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.

    retryFunction

    Keeps calling callback until it returns something other than undefined. There is an exponentially-increasing delay between each retry attempt.

    retryTask

    Keeps trying to run task.

    run

    Runs a series of async expressions, returning the results. Use runSingle if it's only a single result you care about.

    runOnce

    Runs a function once

    runSingle

    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.

    singleItem

    Queue of a single item, only once, allows for simple synchronisation.

    sleep

    Returns after timeout period.

    throttle

    Throttles a function. Callback only allowed to run after minimum of intervalMinMs.

    timeout

    Returns a Timeout that can be triggered, cancelled and reset. Use continuously for interval- based loops.

    timerAlwaysDone

    Returns a ModulationTimer that is always at 100%. Opposite: timerNeverDone.

    timerNeverDone

    Returns a ModulationTimer that is always at 0%. Opposite: timerAlwaysDone.

    timerWithFunction

    Wraps timer, computing a value based on its elapsed value. fn creates this value.

    updateOutdated

    Calls the async fn to generate a value if there is no prior value or interval has elapsed since value was last generated.

    waitFor

    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.

    Classes

    DispatchList

    Maintains a list of listeners to receive data

    Pool

    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.

    PoolUser

    A use of a pool resource

    RequestResponseMatch

    Matches responses with requests, expiring requests if they do not get a response in a timely manner.

    Resource

    A resource allocated in the Pool

    SyncWait

    Simple synchronisation. Supports only a single signal/waiter. Expects one or more calls to .signal() for .forSignal() to resolve

    TaskQueueMutable

    Simple task queue. Each task is awaited and run in turn.

    WaitForValue

    Queue of a single item, only once, allows for simple synchronisation.

    Type Aliases

    AsyncPromiseOrGenerator
    AsyncTask
    BackoffOptions
    BtNode
    BtNodeBase

    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/

    CompletionTimer

    A Timer that has a sense of completion, when isDone returns true. See relative

    Continuously

    Runs a function continuously, returned by continuously

    ContinuouslyAsyncCallback
    ContinuouslyOpts

    Options for continuously

    ContinuouslySyncCallback
    DebouncedFunction

    Debounced function

    DelayOpts

    Delay options

    Dispatch
    ExpressionOrResult
    FullPolicy

    Policy for when the pool is fully used

    HasCompletion
    HasCompletionRunStates
    ModulationTimer
    MovingAverageTimedOptions
    OnStartCalled
    PoolOptions

    Pool options

    PoolState

    State of pool

    PoolUserEventMap
    RateMinimumOptions
    RelativeTimerOpts

    Options for relative timer

    RepeatDelayOpts
    RepeatOpts

    Options for repeat

    RequestResponseMatchEvents
    RequestResponseOptions
    RetryOpts

    Backoff options

    RetryResult

    Result of backoff

    RetryTask
    RunOpts
    RunSingleOpts
    SelNode
    SeqNode
    Task
    TaskQueueEvents
    TaskState
    Timeout

    A resettable timeout, returned by timeout

    TimeoutAsyncCallback
    TimeoutSyncCallback
    Timer

    A timer instance. CompletionTimer also contains an 'isDone' field.

    TimerOpts
    TimerSource

    Creates a timer

    Traversal
    UpdateFailPolicy