IPC::Concurrency::DBI::Application::Instance - Application instance that represents consumption of the limited resource.
Version 1.0.3
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();
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.
Declare that the current instance has finished running and free the slot for a new instance.
Returns the database handle used for this queue.
my $database_handle = $concurrency_manager->_get_database_handle();
Returns the parent IPC::Concurrency::DBI::Application object.
my $application = $instance->_get_application();
Automatically clear the slot used by the current instance when the object is destroyed, if finish() has not been called already.
Guillaume Aubert, <aubertg at cpan.org>.
<aubertg at cpan.org>
Please report any bugs or feature requests to bug-ipc-concurrency-dbi at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IPC-Concurrency-DBI. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-ipc-concurrency-dbi at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc IPC::Concurrency::DBI
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=IPC-Concurrency-DBI
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/IPC-Concurrency-DBI
CPAN Ratings
http://cpanratings.perl.org/d/IPC-Concurrency-DBI
Search CPAN
http://search.cpan.org/dist/IPC-Concurrency-DBI/
Thanks to ThinkGeek (http://www.thinkgeek.com/) and its corporate overlords at Geeknet (http://www.geek.net/), for footing the bill while I eat pizza and write code for them!
Thanks to Jacob Rose <jacob at thinkgeek.com> for suggesting the idea of this module and brainstorming with me about the features it should offer.
<jacob at thinkgeek.com>
Copyright 2011-2012 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/
To install IPC::Concurrency::DBI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IPC::Concurrency::DBI
CPAN shell
perl -MCPAN -e shell install IPC::Concurrency::DBI
For more information on module installation, please visit the detailed CPAN module installation guide.