MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / set

Method set

mcp/src/resolve.ts:74–82  ·  view source on GitHub ↗

Cache a resolution for `ttlMs`. Evicts the oldest entry past the cap.

(bearer: string, value: ResolvedPrincipal)

Source from the content-addressed store, hash-verified

72
73 /** Cache a resolution for `ttlMs`. Evicts the oldest entry past the cap. */
74 set(bearer: string, value: ResolvedPrincipal): void {
75 const key = fingerprintBearer(bearer);
76 if (!this.map.has(key) && this.map.size >= this.opts.maxEntries) {
77 // Map preserves insertion order, so the first key is the oldest.
78 const oldest = this.map.keys().next().value;
79 if (oldest !== undefined) this.map.delete(oldest);
80 }
81 this.map.set(key, { value, expiresAt: this.opts.now() + this.opts.ttlMs });
82 }
83
84 size(): number {
85 return this.map.size;

Callers 12

setQueryParamMethod · 0.80
buildBrowserLoginURLFunction · 0.80
requestMethod · 0.80
callMethod · 0.80
openWSFunction · 0.80
noteShapeFunction · 0.80
handleClientRequestFunction · 0.80
resolve.test.tsFile · 0.80
listAgentMessagesFunction · 0.80
groupIntoThreadsFunction · 0.80
page.test.tsxFile · 0.80

Calls 3

fingerprintBearerFunction · 0.85
hasMethod · 0.80
deleteMethod · 0.45

Tested by 2

openWSFunction · 0.64
noteShapeFunction · 0.64