mloughran / em-hiredis

Eventmachine redis client
MIT License
221 stars 63 forks source link

close_connection doesn't seem to work #12

Closed liamks closed 12 years ago

liamks commented 12 years ago

I'm using em-hiredis v0.1.0 with cramp 0.15.1 and after I call close_connection on @pub and @sub the redis server still says says there are two connections.

  def close_redis
    @subscriptions.each do |sub|
      @sub.unsubscribe(sub)
    end

    @pub.close_connection
    @sub.close_connection
  end
mloughran commented 12 years ago

Sorry for never replying to this. I suspect that what was happening was that the connection was immediately reconnecting.

Regardless, there is now a close_connection method on Client (version 0.1.1) which cancels the reconnect before closing the underlying connection, so if you're still interested, use that :)

liamks commented 12 years ago

Thanks for the update!