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.



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

Parameters:

  • value

    the value to set the attribute on_ready to.



163
164
165
# File 'lib/droonga/job_pusher.rb', line 163

def on_ready=(value)
  @on_ready = value
end

Instance Method Details

#closeObject



181
182
183
# File 'lib/droonga/job_pusher.rb', line 181

def close
  @connection.close
end

#ready?Boolean

Returns:

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