fix readme

This commit is contained in:
Edward 2020-05-07 12:18:03 +08:00
parent a3638a1084
commit 9cb8114cce
3 changed files with 57 additions and 54 deletions

View File

@ -1,4 +1,5 @@
Fan-In Messaging Patterns
# Fan-In Messaging Patterns
===================================
Fan-In is a messaging pattern used to create a funnel for work amongst workers (clients: source, server: destination).
@ -37,4 +38,4 @@ func Merge(cs ...<-chan int) <-chan int {
The `Merge` function converts a list of channels to a single channel by starting a goroutine for each inbound channel that copies the values to the sole outbound channel.
Once all the output goroutines have been started, `Merge` a goroutine is started to close the main channel.
Once all the output goroutine have been started, `Merge` a goroutine is started to close the main channel.

View File

@ -1,4 +1,5 @@
Fan-Out Messaging Pattern
# Fan-Out Messaging Pattern
=========================
Fan-Out is a messaging pattern used for distributing work amongst workers (producer: source, consumers: destination).

View File

@ -2,9 +2,10 @@ package messaging
import (
"context"
"go.uber.org/zap"
"sync"
"sync/atomic"
"go.uber.org/zap"
)
var (