Skip to content

Commit f2bb350

Browse files
committed
rename redisconn.Opts.Async=>AsyncDial
1 parent 72fa945 commit f2bb350

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func Example_usage() {
2626
Logger: redisconn.NoopLogger{}, // shut up logging. Could be your custom implementation.
2727
Handle: myhandle, // custom data, useful for custom logging
2828
// Other parameters (usually, no need to change)
29-
// IOTimeout, DialTimeout, ReconnectTimeout, TCPKeepAlive, Concurrency, WritePause, Async
29+
// IOTimeout, DialTimeout, ReconnectTimeout, TCPKeepAlive, Concurrency, WritePause, AsyncDial
3030
}
3131
conn, err := redisconn.Connect(ctx, "127.0.0.1:6379", opts)
3232
return conn, err

rediscluster/mapping.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (c *Cluster) newNode(addr string, initial bool) (*node, error) {
3838
addr: addr,
3939
refcnt: 1,
4040
}
41-
node.opts.Async = true
41+
node.opts.AsyncDial = true
4242
node.conns = make([]*redisconn.Connection, c.opts.ConnsPerHost)
4343
for i := range node.conns {
4444
node.opts.Handle = ClusterHandle{c.opts.Handle, addr, i}

redisconn/conn.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ type Opts struct {
5858
WritePause time.Duration
5959
// Logger
6060
Logger Logger
61-
// Async - do not establish connection immediately
62-
Async bool
61+
// AsyncDial - do not establish connection immediately
62+
AsyncDial bool
6363
}
6464

6565
// Connection is implementation of redis.Sender which represents single connection to single redis instance.
@@ -143,7 +143,7 @@ func Connect(ctx context.Context, addr string, opts Opts) (conn *Connection, err
143143
conn.opts.Logger = DefaultLogger{}
144144
}
145145

146-
if !conn.opts.Async {
146+
if !conn.opts.AsyncDial {
147147
if err = conn.createConnection(false, nil); err != nil {
148148
if opts.ReconnectPause < 0 {
149149
return nil, err
@@ -154,7 +154,7 @@ func Connect(ctx context.Context, addr string, opts Opts) (conn *Connection, err
154154
}
155155
}
156156

157-
if conn.opts.Async || err != nil {
157+
if conn.opts.AsyncDial || err != nil {
158158
var wg sync.WaitGroup
159159
wg.Add(1)
160160
go func() {
@@ -164,7 +164,7 @@ func Connect(ctx context.Context, addr string, opts Opts) (conn *Connection, err
164164
}()
165165
// in async mode we are still waiting for state to set to connConnecting
166166
// so that Send will put requests into queue
167-
if conn.opts.Async {
167+
if conn.opts.AsyncDial {
168168
wg.Wait()
169169
}
170170
}

0 commit comments

Comments
 (0)