Module: Gearman

Defined in:
lib/gearman/worker/callbacks.rb,
lib/gearman.rb,
lib/gearman/task.rb,
lib/gearman/client.rb,
lib/gearman/packet.rb,
lib/gearman/server.rb,
lib/gearman/worker.rb,
lib/gearman/logging.rb,
lib/gearman/version.rb,
lib/gearman/task_set.rb,
lib/gearman/connection.rb,
lib/gearman/exceptions.rb,
lib/gearman/worker/job.rb,
lib/gearman/worker/ability.rb,
lib/gearman/connection_pool.rb

Overview

Provides callbacks for internal worker use:

def named_metric(metric)

"HardWorker.#{Process.pid}.#{metric}"

end

worker = Gearman::Worker.new worker.on_grab_job { StatsD.increment(named_metric('grab_job')) } worker.on_job_assign { StatsD.increment(named_metric('job_assign')) } worker.on_no_job { StatsD.increment(named_metric('no_job')) } worker.on_work_complete { StatsD.increment(named_metric('work_complete')) }

Defined Under Namespace

Modules: Logging Classes: BackgroundTask, Client, Connection, ConnectionPool, InvalidArgsError, JobQueueError, NetworkError, NoJobServersError, Packet, ProtocolError, Server, ServerDownException, SocketTimeoutError, Task, TaskSet, Worker

Constant Summary collapse

VERSION =
'4.0.4'

Class Attribute Summary collapse

Class Attribute Details

.loggerObject


8
9
10
# File 'lib/gearman.rb', line 8

def logger
  @logger ||= Logger.new(STDOUT)
end