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