class requestManager.RequestManager
extends RequestQueue

Constructors

RequestManager(client: JikanClient)

Properties

Methods

buildURL(requestQuery: apiModel.APIRequestQuery): URL
processQueue(): Promise<void>
request(requestQuery: apiModel.APIRequestQuery): Promise<Response>

request: Enqueue a APIRequestQuery and return a promise of the response

note: Request won't retry if the response isn't valid, it's up to the user to handle the response. Maybe a retry mechanism can be added in the future.

note: If the queue is full, the request will be dropped and a 503 Service Unavailable response will be returned (see the client options to change the queue size)

Usage

import { requestManager } from ".";