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
HTTP RPC Specification | tRPC
Methods Type mapping
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.
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