Go Pattern: Buffered Writer
A buffered writer is so ubiquitous that we do not usually consider it as a pattern, but sometimes we reinvent it or even do it in an inferior way. Let us look at a real use case first. Batch processor What would you do to improve the throughput of a service? The answer is short: batching. By processing and sending in a batch of multiple items instead of a single item at a time, you are amortizing the network overhead from the request-response round trip among all the items in the batch. ...