mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-30 07:26:46 +00:00
dispatch: channel reuse fix (#1237)
* Add test for dispatch channel reuse * Dispatcher - make chans bidirectional * No need to to keep the type assertion separate from the Get() * Unexport Pipe's channel and add getter
This commit is contained in:
@@ -218,7 +218,7 @@ func (d *Dispatcher) publish(id uuid.UUID, data interface{}) error {
|
||||
|
||||
// Subscribe subscribes a system and returns a communication chan, this does not
|
||||
// ensure initial push.
|
||||
func (d *Dispatcher) subscribe(id uuid.UUID) (<-chan interface{}, error) {
|
||||
func (d *Dispatcher) subscribe(id uuid.UUID) (chan interface{}, error) {
|
||||
if d == nil {
|
||||
return nil, errDispatcherNotInitialized
|
||||
}
|
||||
@@ -251,7 +251,7 @@ func (d *Dispatcher) subscribe(id uuid.UUID) (<-chan interface{}, error) {
|
||||
}
|
||||
|
||||
// Unsubscribe unsubs a routine from the dispatcher
|
||||
func (d *Dispatcher) unsubscribe(id uuid.UUID, usedChan <-chan interface{}) error {
|
||||
func (d *Dispatcher) unsubscribe(id uuid.UUID, usedChan chan interface{}) error {
|
||||
if d == nil {
|
||||
return errDispatcherNotInitialized
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user