Create a read-through, request-coalescing cache bound to a hoodchain client.
const cache = createHoodCache(hood)// 100 concurrent calls → exactly 1 RPC round-trip:await Promise.all(Array.from({ length: 100 }, () => cache.getQuote('AAPL')))console.log(cache.stats) // { hits: 99, misses: 1, coalesced: 99 } (approx.) Copy
const cache = createHoodCache(hood)// 100 concurrent calls → exactly 1 RPC round-trip:await Promise.all(Array.from({ length: 100 }, () => cache.getQuote('AAPL')))console.log(cache.stats) // { hits: 99, misses: 1, coalesced: 99 } (approx.)
Create a read-through, request-coalescing cache bound to a hoodchain client.