MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / tryLockBlock

Function tryLockBlock

e2e/src/ports.ts:139–144  ·  view source on GitHub ↗
(block: number)

Source from the content-addressed store, hash-verified

137// the suite's lifetime means two suites racing for the same block can never
138// both win (the second bind EADDRINUSEs and walks on).
139const tryLockBlock = (block: number): Promise<Server | undefined> =>
140 new Promise((done) => {
141 const server = createServer();
142 server.once("error", () => done(undefined));
143 server.listen(block + LOCK_OFFSET, "127.0.0.1", () => done(server));
144 });
145
146/**
147 * Claim a free set of ports for a target and publish them via env. Starts at

Callers 1

claimPortsFunction · 0.85

Calls 1

listenMethod · 0.80

Tested by

no test coverage detected