Guillaume Aubert > IPC-Concurrency-DBI > IPC::Concurrency::DBI::Application::Instance

Download:
IPC-Concurrency-DBI-v1.1.3.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: v1.1.3   Source  

NAME ^

IPC::Concurrency::DBI::Application::Instance - Application instance that represents consumption of the limited resource.

VERSION ^

Version 1.1.3

SYNOPSIS ^

This module represents one instance of an application managed by IPC::Concurrency::DBI.

See the documentation of IPC::Concurrency::DBI for more information.

        my $instance = $concurrent_program->start_instance();
        unless ( defined( $instance ) )
        {
                print "Too many instances of $0 are already running.\n";
                exit;
        }

        # [...] Do some work.

        # Now that the application is about to exit, flag the instance as completed.
        # (note: this is implicit when $instance is destroyed).
        $instance->finish();

METHODS ^

new()

Create a new IPC::Concurrency::DBI::Application::Instance object.

This function should not be called directly and its API could change, instead use IPC::Concurrency::DBI::Application::start_instance().

        # Retrieve the application by name.
        my $instance = IPC::Concurrency::DBI::Application::Instance->new(
                application => $application,
        );

'application': mandatory, an IPC::Concurrency::DBI::Application object.

finish()

Declare that the current instance has finished running and free the slot for a new instance.

INTERNAL METHODS ^

get_application()

Returns the parent IPC::Concurrency::DBI::Application object.

        my $application = $instance->get_application();

DESTROY()

Automatically clear the slot used by the current instance when the object is destroyed, if finish() has not been called already.

BUGS ^

Please report any bugs or feature requests through the web interface at https://github.com/guillaumeaubert/IPC-Concurrency-DBI/issues/new. 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::Concurrency::DBI

You can also look for information at:

AUTHOR ^

Guillaume Aubert, <aubertg at cpan.org>.

COPYRIGHT & LICENSE ^

Copyright 2011-2014 Guillaume Aubert.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/

syntax highlighting: