Class: Droonga::JobPusher::WorkerConnection
- Inherits:
-
Object
- Object
- Droonga::JobPusher::WorkerConnection
- Defined in:
- lib/droonga/job_pusher.rb
Instance Attribute Summary collapse
-
#on_ready ⇒ Object
writeonly
Sets the attribute on_ready.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(connection) ⇒ WorkerConnection
constructor
A new instance of WorkerConnection.
- #ready? ⇒ Boolean
- #write(job) ⇒ Object
Constructor Details
#initialize(connection) ⇒ WorkerConnection
Returns a new instance of WorkerConnection.
165 166 167 168 169 170 |
# File 'lib/droonga/job_pusher.rb', line 165 def initialize(connection) @connection = connection @ready = false @on_ready = nil setup_connection end |
Instance Attribute Details
#on_ready=(value) ⇒ Object (writeonly)
Sets the attribute on_ready
163 164 165 |
# File 'lib/droonga/job_pusher.rb', line 163 def on_ready=(value) @on_ready = value end |
Instance Method Details
#close ⇒ Object
181 182 183 |
# File 'lib/droonga/job_pusher.rb', line 181 def close @connection.close end |
#ready? ⇒ Boolean
172 173 174 |
# File 'lib/droonga/job_pusher.rb', line 172 def ready? @ready end |
#write(job) ⇒ Object
176 177 178 179 |
# File 'lib/droonga/job_pusher.rb', line 176 def write(job) @connection.write(job) @ready = false end |