That's it!
Thx a lot.
Cheers,
Mesel
-Original Message-
From: Perrin Harkins [mailto:[EMAIL PROTECTED]
Sent: Friday, August 12, 2005 16:25
To: Tesfaiesus, Mesel
Cc: modperl@perl.apache.org
Subject: Re: Apache::Singleton (sharing one object)
On Fri, 2005-08-12 at 15:40
n. To
make it switch to process scope, use this:
use base qw (Apache::Singleton::Process);
However, this will only persist in the one process (it's like putting
the object in a global). If what you need is to make it available in
all processes, create it during startup and put it in a global
Shouldn't you be using the database itself to store the
state? Will Apache::Singleton instance replicate itself if
you were to run your application on multiple servers behind
load balancers (for scalability and fail-over purposes)?
If yes, you probably should usw Storage Module to save you
Object as the properties are set to default
every time.
My Testcode is printing out a $counter - which it saved as an attribute
of the object - that's supposed to increment with every request:
### MyClass Module ###
package MyClass;
use base qw (Ap
On Tue, 19 Oct 2004 10:02:06 -0700
Kevin Spencer <[EMAIL PROTECTED]> wrote:
> On Mon, 18 Oct 2004 12:34:28 -0500, Frank Wiles <[EMAIL PROTECTED]>
> wrote:
> >
> > Hi Everyone,
> >
> > I've been trying to reach the maintainer of Apache::Singlet
On Mon, 18 Oct 2004 12:34:28 -0500, Frank Wiles <[EMAIL PROTECTED]> wrote:
>
> Hi Everyone,
>
> I've been trying to reach the maintainer of Apache::Singleton with
> very little success. His name is Tatsuhiko Miyagawa
> <[EMAIL PROTECTED]> I suppl
Frank Wiles wrote:
Hi Everyone,
I've been trying to reach the maintainer of Apache::Singleton with
very little success. His name is Tatsuhiko Miyagawa
<[EMAIL PROTECTED]> I supplied him with a patch that makes the
module work under both mp1 and mp2 back in April and h
Hi Everyone,
I've been trying to reach the maintainer of Apache::Singleton with
very little success. His name is Tatsuhiko Miyagawa
<[EMAIL PROTECTED]> I supplied him with a patch that makes the
module work under both mp1 and mp2 back in April and haven't been
abl
On Wed, 17 Dec 2003 09:32:41 -0800
"Chris Ochs" <[EMAIL PROTECTED]> wrote:
> I'm just trying to see how Apache::Singleton works. If my code is not
> understandable, that's how far off I probably am from knowing how it works..
> That was why I asked if someon
- Original Message -
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Chris Ochs" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, December 17, 2003 10:11 AM
Subject: Re: Apache::Singleton
> Chris Ochs wrote:
> > I'm just tr
Chris Ochs wrote:
I'm just trying to see how Apache::Singleton works. If my code is not
understandable, that's how far off I probably am from knowing how it works..
That was why I asked if someone had a complete sample.
BTW, if you have the "Practical mod_perl" book, pages
> >
> > > I have a hash for the posted cgi variables but
> > > that gets cleared out when it's reset anyways, and I have about 30
> global
> > > variables that I just set explicitly at the start of the code.
> >
> > That sounds fine. Eventually you should probably look at turning those
> > into
Chris Ochs wrote:
Actually I don't think I will use Singleton, it just seems like a lot more
work then it's worth for me.
It's more useful for handling access to an object, like a Template
Toolkit instance for example.
I have a hash for the posted cgi variables but
that gets cleared out when it's
I'm just trying to see how Apache::Singleton works. If my code is not
understandable, that's how far off I probably am from knowing how it works..
That was why I asked if someone had a complete sample.
Actually I don't think I will use Singleton, it just seems like a lot more
Chris Ochs wrote:
Here is the code that I cant' get working, maybe it is easier to just
correct what I have so far...
I'm afraid I can't tell what you're trying to do here. One big problem
with this code is that you're putting the request object ($r, by
convention) into a global. Don't do that
Here is the code that I cant' get working, maybe it is easier to just
correct what I have so far...
package Test::One;
use strict;
use Apache::Constants qw(:common);
use Apache::Singleton::Request;
use base qw(Apache::Singleton::Request);
use vars qw($r);
my $var1 = "test";
sub
Hmmm after playing around with Apache::Singleton I am having a hard time
understanding exactly how you use it. I failed to find even one complete
example of it's use, just bits and pieces, and I'm afraid I don't
understand
how it all fits together. I read the Class::Single
17 matches
Mail list logo