mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 06:31:57 +00:00
rpc: remove the placeholder RunState type. (#7749)
* rpc/client: remove the placeholder RunState type. I added the RunState type in #6971 to disconnect clients from the service plumbing, which they do not need. Now that we have more complete context plumbing, the lifecycle of a client no longer depends on this type: It serves as a carrier for a logger, and a Boolean flag for "running" status, neither of which is used outside of tests. Logging in particular is defaulted to a no-op logger in all production use. Arguably we could just remove the logging calls, since they are never invoked except in tests. To defer the question of whether we should do that or make the logging go somewhere more productive, I've preserved the existing use here. Remove use of the IsRunning method that was provided by the RunState, and use the Start method and context to govern client lifecycle. Remove the one test that exercised "unstarted" clients. I would like to remove that method entirely, but that will require updating the constructors for all the client types to plumb a context and possibly other options. I have deferred that for now.
This commit is contained in:
@@ -32,14 +32,10 @@ import (
|
||||
|
||||
// Client describes the interface of Tendermint RPC client implementations.
|
||||
type Client interface {
|
||||
// These methods define the operational structure of the client.
|
||||
|
||||
// Start the client. Start must report an error if the client is running.
|
||||
// Start the client, which will run until the context terminates.
|
||||
// An error from Start indicates the client could not start.
|
||||
Start(context.Context) error
|
||||
|
||||
// IsRunning reports whether the client is running.
|
||||
IsRunning() bool
|
||||
|
||||
// These embedded interfaces define the callable methods of the service.
|
||||
ABCIClient
|
||||
EventsClient
|
||||
|
||||
Reference in New Issue
Block a user