MCPcopy Create free account
hub / github.com/block/buzz / withReadOnlyRelayClient

Function withReadOnlyRelayClient

desktop/src/shared/api/readOnlyRelayClient.ts:264–274  ·  view source on GitHub ↗
(
  relayUrl: string,
  callback: (client: ReadOnlyRelayClient) => Promise<T>,
)

Source from the content-addressed store, hash-verified

262}
263
264export async function withReadOnlyRelayClient<T>(
265 relayUrl: string,
266 callback: (client: ReadOnlyRelayClient) => Promise<T>,
267): Promise<T> {
268 const client = new ReadOnlyRelayClient(relayUrl);
269 try {
270 return await callback(client);
271 } finally {
272 client.disconnect();
273 }
274}

Callers 1

pollWorkspaceUnreadFunction · 0.90

Calls 1

disconnectMethod · 0.95

Tested by

no test coverage detected