@bitcoinerlab/explorer - v0.4.2
    Preparing search index...

    Type Alias RequestQueueParams

    Parameters for configuring the RequestQueue. This queue is used in HTTP fetch operations in Esplora clients and is an optional input parameter in the EsploraExplorer constructor.

    type RequestQueueParams = {
        maxAttemptsForSoftErrors?: number;
        maxAttemptsForHardErrors?: number;
        unthrottleAfterOkCount?: number;
        unthrottleAfterTime?: number;
        throttleTime?: number;
        maxConcurrentTasks?: number;
    }
    Index

    Properties

    maxAttemptsForSoftErrors?: number

    Maximum number of attempts for soft errors (429 or 50x status). Also applies to network-related throws (e.g., network down or CORS issues). Defaults to 100 attempts.

    maxAttemptsForHardErrors?: number

    Maximum number of attempts for hard errors (other than 429 or 50x). Limits the number of attempts for errors other than 429 and 50x, assuming the network is up. Defaults to 10 attempts.

    unthrottleAfterOkCount?: number

    Number of consecutive successful fetches required to unthrottle. Automatically stops throttling after this many successful responses. Defaults to 10 consecutive successes.

    unthrottleAfterTime?: number

    Time in milliseconds of inactivity after the last fetch before unthrottling. Automatically stops throttling if inactive for this period. Defaults to 2000ms (2 seconds).

    throttleTime?: number

    Time in milliseconds to wait before retrying a fetch request when throttled. Determines the delay between attempts when throttling is active. Defaults to 200ms - 5 req/sec - the 5 r/s of Blockstream esplora: limit_req_zone $limit_key zone=heavylimitzone:10m rate=5r/s; https://github.com/Blockstream/esplora/blob/master/contrib/nginx.conf.in

    maxConcurrentTasks?: number

    Maximum number of concurrent fetch tasks allowed. New fetch tasks will wait throttleTime before retrying if limit is reached. Note that even if maxConcurrentTasks is set, new tasks are not added if the server is struggling (throttling responses). Blockstream allows up to 10 concurrent tasks: limit_req zone=heavylimitzone burst=10 nodelay https://github.com/Blockstream/esplora/blob/master/contrib/nginx.conf.in May be interesting to limit it to lower to match the 5 requests / sec limit, with a throttleTime of 200 ms. Another approch is setting 30 maxConcurrentTasks which is 50% more of typical gapLimit.