Skip to main content
Glama

Convex MCP server

Official
by get-convex
permit.rs1.05 kB
use anyhow::Context; // Similar to releasing the GIL in Python, it's advisable to drop the // ConcurrencyPermit when entering async code on the V8 thread. This helper also // integrates with our user time tracking to not count async code against the // user timeout. use common::{ errors::TIMEOUT_ERROR_MESSAGE, runtime::Runtime, }; use errors::ErrorMetadata; use futures::Future; use crate::{ concurrency_limiter::ConcurrencyPermit, timeout::Timeout, }; pub async fn with_release_permit<RT: Runtime, T>( timeout: &mut Timeout<RT>, permit_slot: &mut Option<ConcurrencyPermit>, f: impl Future<Output = anyhow::Result<T>>, ) -> anyhow::Result<T> { let permit = permit_slot.take().expect("permit should exist"); let f = timeout.with_timeout(permit.with_suspend(f)); let pause_guard = timeout.pause(); let (result, permit) = f.await.context(ErrorMetadata::overloaded( "SystemTimeoutError", TIMEOUT_ERROR_MESSAGE, ))?; pause_guard.resume(); *permit_slot = Some(permit); result }

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/get-convex/convex-backend'

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