mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-25 13:47:19 +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
|
@ -96,6 +96,7 @@ type WSOptions struct {
|
||||||
// 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if c.wsOpts.NonBlockingNotificationsDispatcher {
|
||||||
|
go c.notifySubscribers(ntf)
|
||||||
|
} else {
|
||||||
c.notifySubscribers(ntf)
|
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