Skip to content

Commit

Permalink
Renamed GetConnection to Hijack
Browse files Browse the repository at this point in the history
Also, as a normal hijack, we mark the connection as unhealthy after
hijacking.
  • Loading branch information
dustin committed Feb 4, 2014
1 parent 1d5d887 commit 38423e1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/mc.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,12 @@ func (c *Client) StatsMap(key string) (map[string]string, error) {
return rv, nil
}

// return underlying connection back to the caller.
func (c *Client) GetConnection() io.ReadWriteCloser {
// Hijack exposes the underlying connection from this client.
//
// It also marks the connection as unhealthy since the client will
// have lost control over the connection and can't otherwise verify
// things are in good shape for connection pools.
func (c *Client) Hijack() io.ReadWriteCloser {
c.healthy = false
return c.conn
}

0 comments on commit 38423e1

Please sign in to comment.