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.
159 160 161 162 163 164 |
# File 'lib/droonga/job_pusher.rb', line 159 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
157 158 159 |
# File 'lib/droonga/job_pusher.rb', line 157 def on_ready=(value) @on_ready = value end |
Instance Method Details
#close ⇒ Object
175 176 177 |
# File 'lib/droonga/job_pusher.rb', line 175 def close @connection.close end |
#ready? ⇒ Boolean
166 167 168 |
# File 'lib/droonga/job_pusher.rb', line 166 def ready? @ready end |
#write(job) ⇒ Object
170 171 172 173 |
# File 'lib/droonga/job_pusher.rb', line 170 def write(job) @connection.write(job) @ready = false end |