Class: Droonga::Client::Connection::DroongaProtocol
- Inherits:
-
Object
- Object
- Droonga::Client::Connection::DroongaProtocol
- Defined in:
- lib/droonga/client/connection/droonga-protocol.rb,
lib/droonga/client/connection/droonga-protocol/coolio.rb,
lib/droonga/client/connection/droonga-protocol/thread.rb
Defined Under Namespace
Instance Method Summary collapse
-
#close ⇒ void
Close the connection.
-
#initialize(options = {}) ⇒ DroongaProtocol
constructor
A new instance of DroongaProtocol.
-
#request(message, options = {}, &block) ⇒ Object
Sends a request message and receives one or more response messages.
-
#send(message, options = {}, &block) ⇒ void
Sends low level request.
-
#subscribe(message, options = {}, &block) ⇒ Object
Subscribes something and receives zero or more published messages.
Constructor Details
#initialize(options = {}) ⇒ DroongaProtocol
Returns a new instance of DroongaProtocol.
24 25 26 27 28 29 30 |
# File 'lib/droonga/client/connection/droonga-protocol.rb', line 24 def initialize(={}) @host = [:host] || "127.0.0.1" @port = [:port] || 24224 @tag = [:tag] || "droonga" = @backend = create_backend end |
Instance Method Details
#close ⇒ void
This method returns an undefined value.
Close the connection. This connection can't be used anymore.
104 105 106 |
# File 'lib/droonga/client/connection/droonga-protocol.rb', line 104 def close @backend.close end |
#request(message, options = {}) ⇒ Object #request(message, options = {}) {|response| ... } ⇒ Request
Sends a request message and receives one or more response messages.
56 57 58 |
# File 'lib/droonga/client/connection/droonga-protocol.rb', line 56 def request(, ={}, &block) @backend.request(, , &block) end |
#send(message, options = {}, &block) ⇒ void
This method returns an undefined value.
Sends low level request. Normally, you should use other convenience methods.
97 98 99 |
# File 'lib/droonga/client/connection/droonga-protocol.rb', line 97 def send(, ={}, &block) @backend.send(, , &block) end |
#subscribe(message, options = {}) ⇒ Enumerator #subscribe(message, options = {}) {|message| ... } ⇒ Request
Subscribes something and receives zero or more published messages.
86 87 88 |
# File 'lib/droonga/client/connection/droonga-protocol.rb', line 86 def subscribe(, ={}, &block) @backend.subscribe(, , &block) end |