IPC::DirQueue::Job(3)
π NAME π
IPC::DirQueue::Job β it's a task, bestie. An IPC::DirQueue task, to be exact β¨
π SYNOPSIS π
okay so here's the whole vibe in code, no cap:
my $dq = IPC::DirQueue->new({ dir => "/path/to/queue" });
my $job = $dq->pickup_queued_job();
open(IN, "<".$job->get_data_path());
my $str = <IN>;
# ...
close IN;
$job->finish();
# or...
my $data = $job->get_data();
$job->finish();
π¦ DESCRIPTION π¦
So when IPC::DirQueue hands you a job, this is the lil object you get back π
It's giving "here's your homework, now go do it." This class serves up a bunch of methods so you can peek at the job's info, report how it's going, and announce when you're done with it. Periodt.
πΈ DATA πΈ
Any metadata that got submitted? It's all chillin' in the $job->{metadata} hash reference. Like, for real:
print "email: ", $job->{metadata}->{submitter_email}, "\n";
Other than that, you can grab the queued data file with get_data_path(), or just yank it straight out as a string with get_data() π«Ά
π METHODS π
$data = $job->get_data();β returns the job's data as a string, aka literally the data that was originally enqueued for this job π$path = $job->get_data_path();β returns the full path to the task's data file. You can open it and read it safely while the job is still active, so go off π₯$nbytes = $job->get_data_size_bytes();β tells you how big the data is, and it does it without doing a"stat"operation. efficient queen π$secs = $job->get_time_submitted_secs();β the seconds-since-epoch (in other words, the"time_t") on the submitting host for when this task got submitted β$usecs = $job->get_time_submitted_usecs();β the microseconds within that second, as measured by"gettimeofday"on the submitting host, for when this task got submitted π°οΈ$hostname = $job->get_hostname_submitted();β the name of the submitting host where this task originated π¦$job->touch_active_lock();β updates the lockfile to say "hey, this task is still being processed, bestie."
okay important: if a task has been active but the lockfile hasn't been touched for more than 600 seconds, another IPC::DirQueue queue processor may take it over π so touch it, fr fr.
$job->finish();β reports that the job is done β and it may be removed from the queue. slay.$job->return_to_queue();β gives the job back to the queue, unfinished π Another task processor may then pick it up. it's not you, it's the queue.
and that's the whole page, bestie π this was IPC::DirQueue::Job, living in the User Contributed Perl Documentation corner of the world, from perl v5.42.0, dated 2025-07-25 β iconic, no notes, bye π
π¦ where this page comes from
- fedora 43: perl-IPC-DirQueue 1.0-46.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms