MCPcopy Create free account
hub / github.com/middleapi/orpc / #enqueueRequest

Method #enqueueRequest

packages/client/src/plugins/batch.ts:183–197  ·  view source on GitHub ↗
(
    group: BatchLinkPluginGroup<T>,
    options: InterceptorOptions<StandardLinkClientInterceptorOptions<T>, Promise<StandardLazyResponse>>,
    resolve: (response: StandardLazyResponse) => void,
    reject: (e: unknown) => void,
  )

Source from the content-addressed store, hash-verified

181 }
182
183 #enqueueRequest(
184 group: BatchLinkPluginGroup<T>,
185 options: InterceptorOptions<StandardLinkClientInterceptorOptions<T>, Promise<StandardLazyResponse>>,
186 resolve: (response: StandardLazyResponse) => void,
187 reject: (e: unknown) => void,
188 ): void {
189 const items = this.pending.get(group)
190
191 if (items) {
192 items.push([options, resolve, reject])
193 }
194 else {
195 this.pending.set(group, [[options, resolve, reject]])
196 }
197 }
198
199 async #processPendingBatches(): Promise<void> {
200 const pending = this.pending

Callers 1

initMethod · 0.95

Calls 3

pushMethod · 0.80
setMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected