We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0d09c4 commit 10bef9fCopy full SHA for 10bef9f
conn/conn.go
@@ -222,6 +222,13 @@ func (c *Conn) timeoutRequest(id uint32, timeout time.Duration) {
222
place <- &result{err: ErrTimeout}
223
}
224
225
+// IsClosed returns if the connection is closed
226
+func (c *Conn) IsClosed() bool {
227
+ c.mapMtx.Lock()
228
+ defer c.mapMtx.Unlock()
229
+ return c.closed
230
+}
231
+
232
// sendOp sends operation, returning a channel to wait for results
233
func (c *Conn) sendOp(ctx context.Context, op protocol.Operation) (chan *result, error) {
234
span, ctx := opentracing.StartSpanFromContext(ctx, "Conn.sendOp")
0 commit comments