Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Parallel-ForkManager CPAN distribution.

Report information
The Basics
Id: 101079
Status: resolved
Priority: 0/
Queue: Parallel-ForkManager

People
Owner: dlux [...] dlux.hu
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.07
Fixed in: (no value)



Subject: New accessor get_max_procs
It would be nice if there was a get_max_procs accessor. See attached patch. The idea is to be able to do something like $SIG{TTIN} = sub { $pm->set_max_procs($pm->get_max_procs + 1); }; without maintaining an extra variable.
Subject: pfm-get-max-procs.patch
diff -r 94e0c26dc0bb lib/Parallel/ForkManager.pm --- a/lib/Parallel/ForkManager.pm Mon Nov 10 09:11:33 2014 +0200 +++ b/lib/Parallel/ForkManager.pm Mon Dec 22 17:36:35 2014 +0100 @@ -630,6 +630,11 @@ $s->{max_proc} = $mp; } +sub get_max_procs { + my ($s)=@_; + return $s->{max_proc}; +} + # OS dependant code follows... sub _waitpid { # Call waitpid() in the standard Unix fashion.
Hi, I'm happy to accept the patch. Can you please apply it to the repository itself? I'm unsure about the best procedure, but it would be good to have the author data preserved. Balázs On Mon Dec 22 11:39:32 2014, SREZIC wrote: Show quoted text
> It would be nice if there was a get_max_procs accessor. See attached > patch. The idea is to be able to do something like > > $SIG{TTIN} = sub { > $pm->set_max_procs($pm->get_max_procs + 1); > }; > > without maintaining an extra variable.
Th repository is here btw: https://github.com/szabgab/perl-parallel-forkmanager/compare On Thu Jan 01 19:40:14 2015, DLUX wrote: Show quoted text
> Hi, > > I'm happy to accept the patch. Can you please apply it to the > repository itself? I'm unsure about the best procedure, but it would > be good to have the author data preserved. > > Balázs > > On Mon Dec 22 11:39:32 2014, SREZIC wrote:
> > It would be nice if there was a get_max_procs accessor. See attached > > patch. The idea is to be able to do something like > > > > $SIG{TTIN} = sub { > > $pm->set_max_procs($pm->get_max_procs + 1); > > }; > > > > without maintaining an extra variable.
-> https://github.com/szabgab/perl-parallel-forkmanager/pull/2 Now with doc and test script. On 2015-01-01 19:40:45, DLUX wrote: Show quoted text
> Th repository is here btw: https://github.com/szabgab/perl-parallel- > forkmanager/compare > > On Thu Jan 01 19:40:14 2015, DLUX wrote:
> > Hi, > > > > I'm happy to accept the patch. Can you please apply it to the > > repository itself? I'm unsure about the best procedure, but it would > > be good to have the author data preserved. > > > > Balázs > > > > On Mon Dec 22 11:39:32 2014, SREZIC wrote:
> > > It would be nice if there was a get_max_procs accessor. See > > > attached > > > patch. The idea is to be able to do something like > > > > > > $SIG{TTIN} = sub { > > > $pm->set_max_procs($pm->get_max_procs + 1); > > > }; > > > > > > without maintaining an extra variable.
On 2015-01-02 05:03:08, SREZIC wrote: Show quoted text
> -> https://github.com/szabgab/perl-parallel-forkmanager/pull/2 > Now with doc and test script. > > On 2015-01-01 19:40:45, DLUX wrote:
> > Th repository is here btw: https://github.com/szabgab/perl-parallel- > > forkmanager/compare > > > > On Thu Jan 01 19:40:14 2015, DLUX wrote:
> > > Hi, > > > > > > I'm happy to accept the patch. Can you please apply it to the > > > repository itself? I'm unsure about the best procedure, but it would > > > be good to have the author data preserved. > > > > > > Balázs > > > > > > On Mon Dec 22 11:39:32 2014, SREZIC wrote:
> > > > It would be nice if there was a get_max_procs accessor. See > > > > attached > > > > patch. The idea is to be able to do something like > > > > > > > > $SIG{TTIN} = sub { > > > > $pm->set_max_procs($pm->get_max_procs + 1); > > > > }; > > > > > > > > without maintaining an extra variable.
> >
In the meanwhile an accessor exists: https://metacpan.org/pod/Parallel::ForkManager#max_procs