May. 12th, 2010

pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
[personal profile] pauamma
LJ::Typemap calls LJ::MemCache, but doesn't actually "use LJ::MemCache;" or call LJ::MemCache::init, relying instead on ljlib.pl to do both. In web context, ljlib.pl is loaded through Apache::LiveJournal, and for worker processes, through LJ::Worker::Manual. For other executables (eg, proof of concept, throwaway learning tools, etc) which don't fall in either category, what should happen?

Options are:
1- Make LJ::Typemap (and everything else that relies on LJ::MemCache) use it and initialize it explicitely. This requires changes to LJ::MemCache, because LJ::MemCache::init isn't currently idempotent.
2- Require all programs using LJ::MemCache to use base 'LJ::Worker::Manual'; (but that in turn requires making them workers, with a LJ::Worker::Foo package that's started from main, which is awkward for throw-away programs).
3- Make LJ::MemCache initialize itself when loaded, and remove explicit initialization from everywhere else that uses it, but that's extensive.
4- Something else I forgot.

I'm leaning toward 2 ATM. Anyone has a better solution, an opinion, or comments?

Profile

dw_dev: The word "develop" using the Swirly D logo.  (Default)
Dreamwidth Open Source Development

June 2025

S M T W T F S
1234567
89101112 1314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 5th, 2025 09:33 am
Powered by Dreamwidth Studios