[djabberd] kane, r795: r6532@coke: josboum | 2008-08-05 16:30...
Martin Atkins
mart at degeneration.co.uk
Wed Aug 6 18:02:24 UTC 2008
Brad Fitzpatrick wrote:
> Yeah, that works, or some general accessor on vhost.
>
> Perhaps during configuration parsing, we keep a map from classname to
> instantiated object, and then clients can say
> $vhost->by_class("DJabberd::RosterStorage") and then the vhost iterates
> over all its instantiated objects looking for something that
> UNIVERSAL::isa("DJabberd::RosterStorage"), finding first, say,
> "DJabberd::RosterStorage::SQLite" and caching that in some vhost member
> hashref to make lookup faster later.
>
Did you mean this to be specifically for RosterStorage?
I ask because for other types it's not uncommon for the same class to be
instantiated several times in the same VHost. Consider
DJabberd::Component::External, for example.
Since the roster-related hooks have a decline method on $cb I assume
that it's intended to be possible for there to be several RosterStorage
plugins loaded simultaneously too. I guess you could imagine overlaying
a writable sqlite rosterstorage with a read-only LDAP one that declines
all writes to allow them to pass through.
More information about the Djabberd
mailing list