Method
enqueue
(task: () => Promise<void>)
Source from the content-addressed store, hash-verified
| 381 | } |
| 382 | |
| 383 | private enqueue(task: () => Promise<void>) { |
| 384 | const operation = this.pendingWrite.then(async () => { |
| 385 | if (this.writeError) { |
| 386 | throw this.writeError; |
| 387 | } |
| 388 | |
| 389 | await task(); |
| 390 | }); |
| 391 | this.pendingWrite = operation.then( |
| 392 | () => undefined, |
| 393 | () => undefined, |
| 394 | ); |
| 395 | |
| 396 | return operation.catch((error) => { |
| 397 | this.writeError = normalizeError(error); |
| 398 | throw this.writeError; |
| 399 | }); |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | export const canUseRecordingSpool = () => |