mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-21 23:29:38 +00:00
rpcclient: send notificaitons processing to a separate routine
Pavel is struggling without it. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
c960a7eb47
commit
5e5e7d9482
1 changed files with 7 additions and 2 deletions
|
@ -95,7 +95,8 @@ type WSOptions struct {
|
||||||
// corresponding subscription is kept even after receiver's channel closing,
|
// corresponding subscription is kept even after receiver's channel closing,
|
||||||
// thus it's still the caller's duty to call Unsubscribe() for this
|
// thus it's still the caller's duty to call Unsubscribe() for this
|
||||||
// subscription.
|
// subscription.
|
||||||
CloseNotificationChannelIfFull bool
|
CloseNotificationChannelIfFull bool
|
||||||
|
NonBlockingNotificationsDispatcher bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// notificationReceiver is an interface aimed to provide WS subscriber functionality
|
// notificationReceiver is an interface aimed to provide WS subscriber functionality
|
||||||
|
@ -589,7 +590,11 @@ readloop:
|
||||||
break readloop
|
break readloop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
c.notifySubscribers(ntf)
|
if c.wsOpts.NonBlockingNotificationsDispatcher {
|
||||||
|
go c.notifySubscribers(ntf)
|
||||||
|
} else {
|
||||||
|
c.notifySubscribers(ntf)
|
||||||
|
}
|
||||||
} else if rr.ID != nil && (rr.Error != nil || rr.Result != nil) {
|
} else if rr.ID != nil && (rr.Error != nil || rr.Result != nil) {
|
||||||
id, err := strconv.ParseUint(string(rr.ID), 10, 64)
|
id, err := strconv.ParseUint(string(rr.ID), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue