mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-29 06:01:21 +00:00
godoc comments
This commit is contained in:
parent
c543699d15
commit
1a6eb2ef00
@ -242,12 +242,14 @@ func (s *Server) UnsubscribeAll(ctx context.Context, clientID string) error {
|
||||
}
|
||||
}
|
||||
|
||||
// NumClients returns the number of clients.
|
||||
func (s *Server) NumClients() int {
|
||||
s.mtx.RLock()
|
||||
defer s.mtx.RUnlock()
|
||||
return len(s.subscriptions)
|
||||
}
|
||||
|
||||
// NumClientSubscriptions returns the number of subscriptions the client has.
|
||||
func (s *Server) NumClientSubscriptions(clientID string) int {
|
||||
s.mtx.RLock()
|
||||
defer s.mtx.RUnlock()
|
||||
|
@ -272,6 +272,7 @@ func newWSEvents(cdc *amino.Codec, remote, endpoint string) *WSEvents {
|
||||
return wsEvents
|
||||
}
|
||||
|
||||
// OnStart implements cmn.Service by starting WSClient and event loop.
|
||||
func (w *WSEvents) OnStart() error {
|
||||
w.ws = rpcclient.NewWSClient(w.remote, w.endpoint, rpcclient.OnReconnect(func() {
|
||||
w.redoSubscriptions()
|
||||
@ -287,12 +288,9 @@ func (w *WSEvents) OnStart() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Stop wraps the BaseService/eventSwitch actions as Start does
|
||||
// OnStop implements cmn.Service by stopping WSClient.
|
||||
func (w *WSEvents) OnStop() {
|
||||
err := w.ws.Stop()
|
||||
if err != nil {
|
||||
w.Logger.Error("failed to stop WSClient", "err", err)
|
||||
}
|
||||
_ = w.ws.Stop()
|
||||
}
|
||||
|
||||
// Subscribe implements EventsClient by using WSClient to subscribe given
|
||||
|
@ -74,9 +74,13 @@ var (
|
||||
|
||||
logger log.Logger
|
||||
|
||||
// XXX: godoc comment
|
||||
// config variables
|
||||
|
||||
// MaxSubscriptionClients mirrors RPCConfig.MaxSubscriptionClients
|
||||
MaxSubscriptionClients int
|
||||
// MaxSubscriptionsPerClient mirrors RPCConfig.MaxSubscriptionsPerClient
|
||||
MaxSubscriptionsPerClient int
|
||||
// TimeoutBroadcastTxCommit mirrors RPCConfig.TimeoutBroadcastTxCommit
|
||||
TimeoutBroadcastTxCommit time.Duration
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user