Author image Alan Kasindorf
and 1 contributors

NAME

Garivini::Injector - Synchronously inject jobs into Garivini

DESCRIPTION

Gearman worker for submitting jobs into Garivini via Gearman. Clients should synchronously send jobs through this worker, which are then stored into the Garivini DB before returning to the client.

Any actual job execution is run asynchronously, by way of a Garivini::Controller worker.

Jobs may be submitted with any language. You need to run enough of these workers so jobs may be quickly pulled out and queued into the database.

NOTE that this worker is only required if low latency is desired, or you wish to use a pure Gearman client. If using Garivini::Client directly, only Garivini::QueueRunner workers are needed.

SYNOPSIS

    my $worker = Garivini::Controller->new(dbs => {
        1 => { id => 1, dsn => 'DBI:mysq:job:host=127.0.0.1', user => 'job',
            pass => 'job' } },
        job_servers => ['127.0.0.1'],
        queue_watermark_depth => 4000);
    $worker->work;

OPTIONS

queue_watermark_depth

UNIMPLEMENTED! After writing a job to the database, but before submitting it back into Gearman for execution, the queue depth for that particular function is checked. If there are more than queue_watermark_depth jobs presently waiting for execution, the job will not be directly executed.

Instead, Garivini::QueueRunner will queue the job for execution after Gearman's queues have depleted enough. Use this to help avoid running Gearmand out of memory.

Set to 0 to disable.