Skip to main content
Glama

mcp-google-sheets

promise-queue.ts545 B
import { Mutex } from 'async-mutex'; export class PromiseQueue { private queue: (() => Promise<unknown>)[] = []; private lock: Mutex = new Mutex(); private halted = false; add(promise: () => Promise<unknown>) { this.queue.push(promise); this.run(); } halt() { this.halted = true; } size() { return this.queue.length; } private run() { this.lock.runExclusive(async () => { const promise = this.queue.shift()!; if (this.halted) { return; } await promise(); }); } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server