Skip to content

Commit

Permalink
Merge pull request #7 from AliasYermukanov/master
Browse files Browse the repository at this point in the history
changed from mytex to rwmytes
  • Loading branch information
djumanoff authored Aug 29, 2019
2 parents 858a109 + 1464c5b commit 5a74442
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type (

responseQ string

rpcChannelsMu sync.Mutex
rpcChannelsMu sync.RWMutex
rpcChannels map[string]chan Message

close chan bool
Expand Down Expand Up @@ -87,9 +87,11 @@ func (clt *client) run() error {
for {
select {
case d := <-msgs:
clt.rpcChannelsMu.RLock()
if c, ok := clt.rpcChannels[d.CorrelationId]; ok {
c <- deliveryToMessage(d)
}
clt.rpcChannelsMu.RUnlock()
case <-clt.close:
fmt.Println("cleanup here?")
clt.cleanup()
Expand Down

0 comments on commit 5a74442

Please sign in to comment.