The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

IPC::Queue::Duplex - Filesystem based request / response queue

VERSION

 $Revision: 1.007 $
 $Date: Sun Jun 25 01:43:14 PDT 2017 $

SYNOPSIS

    (Enqueuer)

    use IPC::Queue::Duplex;

    my $client = new IPC::Queue::Duplex (Dir => $dir);
    my $job = $client->add($jobstr);
    my $response = $job->response;

    (Worker)

    use IPC::Queue::Duplex;

    my $server = new IPC::Queue::Duplex (Dir => $dir);
    my $job = $server->get:
    process_job($job);
    $job->finish($result);

METHODS

new

Creates and returns a new IPC::Queue::Duplex object. Requires one named parameter:

    Dir - The directory that will contain the queue for this object. It's important to use a unique directory per queue,

add

Adds a job to the queue and returns an IPC::Queue::Duplex::Job object. A single aregument is required, the job request as a string.

get

Gets a job from the queue and returns an IPC::Queue::Duplex::Job object. Returns undef if there is no job waiting.

addfile

Adds a job to the queue, with an explicitly provided filename, and returns an IPC::Queue::Duplex::Job object. Two arguments are required: the filename to use for the job, and the job request string, in that order.

getresponse

Get a response from the queue. Normally a requester would hold on to their job object and get the response by calling the response method on that object. However, a requester can can also handle responses asynchronously and call this method to get the next waiting response instead. Returns an IPC::Queue::Duplex::Job object, or undef if there is no response on the queue.

AUTHOR

Ashish Gulhati, <ipc-qd at hash.neo.tc>

BUGS

Please report any bugs or feature requests to bug-ipc-queue-duplex at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IPC-Queue-Duplex. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc IPC::Queue::Duplex

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright (c) 2017 Ashish Gulhati.

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.

See http://www.perlfoundation.org/artistic_license_2_0 for the full license terms.