Hello,
I want to implement a singleton pattern on my logger module. During
initial instantiation, the logger module is seeded with some
information (ie. transactionId) and creates some (ie. requestTime).
What I want is for the logger object to be instantiated (if needed)
and/or retrieved from the
On Fri 07 Nov 2008, Steven Siebert wrote:
> Is there any way to have a MPM-safe (specifically thread-safe)
> singleton pattern?
Modperl manages an interpreter pool if it runs under a threaded MPM.
That means the first modperl-related action in the request cycle pulls
an interpreter from the pool
> The simplest way is to put the object as a pnote:
What Torsten said, but have a look at
http://search.cpan.org/~miyagawa/Apache-Singleton-0.07/lib/Apache/Singleton.pm
Apache::Singleton::Request is probably what you want.
Perfect! Great info from both...exactly what I needed. After
Torsten's response, I theorized that I could abstract that
functionality up and reveal a thin API for the creation/calling of
singleton objects within a namespace in pnotesbut that seems to
have already been done with Apache::Single
Am Freitag, 7. November 2008 19:22:56 schrieb Steven Siebert:
> Perfect! Great info from both...exactly what I needed. After
> Torsten's response, I theorized that I could abstract that
> functionality up and reveal a thin API for the creation/calling of
> singleton objects within a namespace in
> I couldn't get Apache::Singleton working with mp2 (used it before with no
> problems with mp1). so I switched back to Class::Singelton ...
*sigh*, 2 yr old bug report. Maybe someone should write to the
author/maintainer and take ownership ?
http://rt.cpan.org/Public/Bug/Display.html?id=19775
E