Skip to content
Client
Server

Reference / @open-music-sdk/core / tRateLimiter

Interface: tRateLimiter ​

Defined in: packages/core/src/rate-limit.ts:5

What paces requests: the client asks it before each attempt is sent, and sends when it answers. createRateLimiter makes one; an app may hand the client its own, with the same acquire.

Methods ​

acquire() ​

ts
acquire(signal?): Promise<void>;

Defined in: packages/core/src/rate-limit.ts:13

Resolves when a request may go. Rejects with the abort reason as soon as signal fires, wherever the caller is in the queue. What it rejects with, the request that asked rejects with, as it is.

Parameters ​

signal? ​

AbortSignal

The request's own signal, when it has one.

Returns ​

Promise<void>

Throws ​

The reason signal aborted with, when it does.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.