hachoter
hachoter2y ago

how does batching work?

My understanding is that batching basically combines multiple requests in a single network request, does this require any setup on my end? How does trpc know to wait for another request to batch it together?
3 Replies
Alex / KATT 🐱
HTTP Batch Link | tRPC
httpBatchLink is a terminating link that batches an array of individual tRPC operations into a single HTTP request that's sent to a single tRPC procedure.
Alex / KATT 🐱
the simple explanation is that we always wait 1ms before excuting any requests and then we combine them into one similar to the dataloader library if you're fmailiar with that

Did you find this page helpful?