Author image Alan Kasindorf
and 1 contributors


Garivini::Injector - Synchronously inject jobs into Garivini


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.


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



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.