mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
Dispatch: Fix race during stop (#1443)
* Dispatch: Assertify tests * Dispatch: Fix race during stop If we have blocking writers, then we need to synchronise them exiting before closing off their channels. * Dispatch: Rename Routes mutex for clarity
This commit is contained in:
@@ -29,8 +29,8 @@ type Dispatcher struct {
|
||||
// then publish the data across the full registered channels for that uuid.
|
||||
// See relayer() method below.
|
||||
routes map[uuid.UUID][]chan interface{}
|
||||
// rMtx protects the routes variable ensuring acceptable read/write access
|
||||
rMtx sync.RWMutex
|
||||
// routesMtx protects the routes variable ensuring acceptable read/write access
|
||||
routesMtx sync.Mutex
|
||||
|
||||
// Persistent buffered job queue for relayers
|
||||
jobs chan job
|
||||
|
||||
Reference in New Issue
Block a user