class requestManager.RequestManager
extends RequestQueue

Constructors

new
RequestManager(client: JikanClient)

Properties

private
_isProcessing: boolean

Methods

private
_createErrorResponse(
message: string,
errorCode: string,
status: number,
statusText: string,
retryAfter?: number,
): Response
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)