common -> cmn

This commit is contained in:
Jae Kwon
2017-01-23 20:26:17 -08:00
parent a33b75fe8b
commit 9745f07bee
15 changed files with 42 additions and 42 deletions

View File

@ -5,11 +5,11 @@ import (
"sync"
"github.com/tendermint/abci/types"
common "github.com/tendermint/go-common"
cmn "github.com/tendermint/go-common"
)
type Client interface {
common.Service
cmn.Service
SetResponseCallback(Callback)
Error() error

View File

@ -10,13 +10,13 @@ import (
grpc "google.golang.org/grpc"
"github.com/tendermint/abci/types"
common "github.com/tendermint/go-common"
cmn "github.com/tendermint/go-common"
)
// A stripped copy of the remoteClient that makes
// synchronous calls using grpc
type grpcClient struct {
common.BaseService
cmn.BaseService
mustConnect bool
client types.ABCIApplicationClient
@ -32,13 +32,13 @@ func NewGRPCClient(addr string, mustConnect bool) (*grpcClient, error) {
addr: addr,
mustConnect: mustConnect,
}
cli.BaseService = *common.NewBaseService(nil, "grpcClient", cli)
cli.BaseService = *cmn.NewBaseService(nil, "grpcClient", cli)
_, err := cli.Start() // Just start it, it's confusing for callers to remember to start.
return cli, err
}
func dialerFunc(addr string, timeout time.Duration) (net.Conn, error) {
return common.Connect(addr)
return cmn.Connect(addr)
}
func (cli *grpcClient) OnStart() error {

View File

@ -4,11 +4,11 @@ import (
"sync"
types "github.com/tendermint/abci/types"
common "github.com/tendermint/go-common"
cmn "github.com/tendermint/go-common"
)
type localClient struct {
common.BaseService
cmn.BaseService
mtx *sync.Mutex
types.Application
Callback
@ -22,7 +22,7 @@ func NewLocalClient(mtx *sync.Mutex, app types.Application) *localClient {
mtx: mtx,
Application: app,
}
cli.BaseService = *common.NewBaseService(log, "localClient", cli)
cli.BaseService = *cmn.NewBaseService(log, "localClient", cli)
return cli
}

View File

@ -11,7 +11,7 @@ import (
"time"
"github.com/tendermint/abci/types"
common "github.com/tendermint/go-common"
cmn "github.com/tendermint/go-common"
)
const (
@ -27,10 +27,10 @@ const flushThrottleMS = 20 // Don't wait longer than...
// the application in general is not meant to be interfaced
// with concurrent callers.
type socketClient struct {
common.BaseService
cmn.BaseService
reqQueue chan *ReqRes
flushTimer *common.ThrottleTimer
flushTimer *cmn.ThrottleTimer
mustConnect bool
mtx sync.Mutex
@ -45,14 +45,14 @@ type socketClient struct {
func NewSocketClient(addr string, mustConnect bool) (*socketClient, error) {
cli := &socketClient{
reqQueue: make(chan *ReqRes, reqQueueSize),
flushTimer: common.NewThrottleTimer("socketClient", flushThrottleMS),
flushTimer: cmn.NewThrottleTimer("socketClient", flushThrottleMS),
mustConnect: mustConnect,
addr: addr,
reqSent: list.New(),
resCb: nil,
}
cli.BaseService = *common.NewBaseService(nil, "socketClient", cli)
cli.BaseService = *cmn.NewBaseService(nil, "socketClient", cli)
_, err := cli.Start() // Just start it, it's confusing for callers to remember to start.
return cli, err
@ -65,7 +65,7 @@ func (cli *socketClient) OnStart() error {
var conn net.Conn
RETRY_LOOP:
for {
conn, err = common.Connect(cli.addr)
conn, err = cmn.Connect(cli.addr)
if err != nil {
if cli.mustConnect {
return err