MCPcopy Create free account
hub / github.com/CommE2E/comm / queueCommand

Method queueCommand

native/media/media-processing-queue.js:31–49  ·  view source on GitHub ↗
(
    type: QueuedCommandType,
    wrappedCommand: () => Promise<R>,
  )

Source from the content-addressed store, hash-verified

29 currentCalls: CallCounter = { process: 0, probe: 0 };
30
31 queueCommand<R>(
32 type: QueuedCommandType,
33 wrappedCommand: () => Promise<R>,
34 ): Promise<R> {
35 return new Promise((resolve, reject) => {
36 const runCommand = async () => {
37 try {
38 const result = await wrappedCommand();
39 this.currentCalls[type]--;
40 this.possiblyRunCommands();
41 resolve(result);
42 } catch (e) {
43 reject(e);
44 }
45 };
46 this.queue.push({ type, runCommand });
47 this.possiblyRunCommands();
48 });
49 }
50
51 possiblyRunCommands() {
52 let openSlots: { [string]: number } = {};

Callers 4

transcodeVideoMethod · 0.95
generateThumbnailMethod · 0.95
getVideoInfoMethod · 0.95
hasMultipleFramesMethod · 0.95

Calls 2

possiblyRunCommandsMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected