← Concurrency In Go

Sample Note

awscloud

Patterns

  1. The for-select loop
  2. The or-channel
  3. Fan-Out, Fan-In
  4. The or-done-channel
  5. The tee-channel
  6. The bridge-channel (for a channel of channels)
  7. Queuing

Queuing

Queuing is the last optimization to implement.
As the queuing in memory has a tendency to lose all the data inside queue if the queue panics.

Little's Law

Little's law is used to calculate the proper queue size based on the system ingress, egress and processing time.

Notes for channel

Setting nil to channel is consider as the channel is not ready when we use is select.
Select choose channel which is ready.