Class: Droonga::JobPusher::WorkerConnection

Inherits:
Object
  • Object
show all
Defined in:
lib/droonga/job_pusher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Parameters:

  • value

    the value to set the attribute on_ready to.



157
158
159
# File 'lib/droonga/job_pusher.rb', line 157

def on_ready=(value)
  @on_ready = value
end

Instance Method Details

#closeObject



175
176
177
# File 'lib/droonga/job_pusher.rb', line 175

def close
  @connection.close
end

#ready?Boolean

Returns:

  • (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