MCPcopy Create free account
hub / github.com/modelcontextprotocol/typescript-sdk / createLatch

Function createLatch

test/shared/protocol.test.ts:111–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

109}
110
111function createLatch() {
112 let latch = false;
113 const waitForLatch = async () => {
114 while (!latch) {
115 await new Promise(resolve => setTimeout(resolve, 0));
116 }
117 };
118
119 return {
120 releaseLatch: () => {
121 latch = true;
122 },
123 waitForLatch
124 };
125}
126
127function assertErrorResponse(o: ResponseMessage<Result>): asserts o is ErrorMessage {
128 expect(o.type).toBe('error');

Callers 1

protocol.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…