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.
146 147 148 149 150 151 |
# File 'lib/droonga/job_pusher.rb', line 146 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
144 145 146 |
# File 'lib/droonga/job_pusher.rb', line 144 def on_ready=(value) @on_ready = value end |
Instance Method Details
#close ⇒ Object
162 163 164 |
# File 'lib/droonga/job_pusher.rb', line 162 def close @connection.close end |
#ready? ⇒ Boolean
153 154 155 |
# File 'lib/droonga/job_pusher.rb', line 153 def ready? @ready end |
#write(job) ⇒ Object
157 158 159 160 |
# File 'lib/droonga/job_pusher.rb', line 157 def write(job) @connection.write(job) @ready = false end |