[Rt-commit] r6299 - in IPC-PubSub: . inc inc/Module
inc/Module/Install lib lib/IPC lib/IPC/PubSub
lib/IPC/PubSub/Cache lib/IPC/PubSub/Cache/JiftyDBI
lib/IPC/PubSub/Cache/JiftyDBI/Stash t
audreyt at bestpractical.com
audreyt at bestpractical.com
Wed Oct 25 12:21:22 EDT 2006
Author: audreyt
Date: Wed Oct 25 12:21:07 2006
New Revision: 6299
Added:
IPC-PubSub/Changes
IPC-PubSub/IPC-PubSub-0.10.tar.gz (contents, props changed)
IPC-PubSub/MANIFEST
IPC-PubSub/META.yml
IPC-PubSub/Makefile
IPC-PubSub/Makefile.PL
IPC-PubSub/README
IPC-PubSub/inc/
IPC-PubSub/inc/.author/
IPC-PubSub/inc/Module/
IPC-PubSub/inc/Module/Install/
IPC-PubSub/inc/Module/Install.pm
IPC-PubSub/inc/Module/Install/Base.pm
IPC-PubSub/inc/Module/Install/Can.pm
IPC-PubSub/inc/Module/Install/Fetch.pm
IPC-PubSub/inc/Module/Install/Makefile.pm
IPC-PubSub/inc/Module/Install/Metadata.pm
IPC-PubSub/inc/Module/Install/Win32.pm
IPC-PubSub/inc/Module/Install/WriteAll.pm
IPC-PubSub/lib/
IPC-PubSub/lib/IPC/
IPC-PubSub/lib/IPC/PubSub/
IPC-PubSub/lib/IPC/PubSub.pm
IPC-PubSub/lib/IPC/PubSub/Cache/
IPC-PubSub/lib/IPC/PubSub/Cache/DBM_Deep.pm
IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI/
IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI.pm
IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI/Stash/
IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI/Stash.pm
IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI/Stash/Item.pm
IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI/Stash/Publisher.pm
IPC-PubSub/lib/IPC/PubSub/Cache/Memcached.pm
IPC-PubSub/lib/IPC/PubSub/Cache/PlainHash.pm
IPC-PubSub/lib/IPC/PubSub/Cacheable.pm
IPC-PubSub/lib/IPC/PubSub/Publisher.pm
IPC-PubSub/lib/IPC/PubSub/Subscriber.pm
IPC-PubSub/t/
IPC-PubSub/t/basic.t
Log:
* IPC::PubSub 0.10.
Added: IPC-PubSub/Changes
==============================================================================
--- (empty file)
+++ IPC-PubSub/Changes Wed Oct 25 12:21:07 2006
@@ -0,0 +1,28 @@
+[Changes for 0.10 - 2006-10-25]
+
+* Renamed from MessageBus.pm to IPC::PubSub.
+* IPC::PubSub's factory methods are now ->new_subscriber and ->new_publisher.
+* New ->channels API for Publisher and Subscriber objects.
+* New ->publish, ->unpublish and ->expiry APIs for Publisher objects.
+* New ->subscribe, ->unsubscribe APIs for Subscriber objects.
+
+[Changes for 0.04 - 2006-10-24]
+
+* Expose ->lock, ->unlock, ->fetch, ->store APIs into the IPC::PubSub object.
+* Implement ->lock and ->unlock methods for non-Memcached backends.
+* The tests are no longer entirely skipped when memcached is not running.
+
+[Changes for 0.03 - 2006-10-24]
+
+* New backend: JiftyDBI.
+* Multiple publishers now work in DBM_Deep and Memcached backends.
+* Memcached now atomically handles publisher announcement and removal.
+
+[Changes for 0.02 - 2006-10-24]
+
+* Thanks to mstrout++ this thing actually works now. :-)
+* Switched from Class::InsideOut to Class::Accessor::Fast.
+
+[Changes for 0.01 - 2006-10-24]
+
+* Initial release to CPAN of this three-hours-old hack.
Added: IPC-PubSub/IPC-PubSub-0.10.tar.gz
==============================================================================
Binary file. No diff available.
Added: IPC-PubSub/MANIFEST
==============================================================================
--- (empty file)
+++ IPC-PubSub/MANIFEST Wed Oct 25 12:21:07 2006
@@ -0,0 +1,25 @@
+Changes
+inc/Module/Install.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+lib/IPC/PubSub.pm
+lib/IPC/PubSub/Cache/DBM_Deep.pm
+lib/IPC/PubSub/Cache/JiftyDBI.pm
+lib/IPC/PubSub/Cache/JiftyDBI/Stash.pm
+lib/IPC/PubSub/Cache/JiftyDBI/Stash/Item.pm
+lib/IPC/PubSub/Cache/JiftyDBI/Stash/Publisher.pm
+lib/IPC/PubSub/Cache/Memcached.pm
+lib/IPC/PubSub/Cache/PlainHash.pm
+lib/IPC/PubSub/Cacheable.pm
+lib/IPC/PubSub/Publisher.pm
+lib/IPC/PubSub/Subscriber.pm
+Makefile.PL
+MANIFEST This list of files
+META.yml
+README
+t/basic.t
Added: IPC-PubSub/META.yml
==============================================================================
--- (empty file)
+++ IPC-PubSub/META.yml Wed Oct 25 12:21:07 2006
@@ -0,0 +1,16 @@
+abstract: Interprocess Publish/Subscribe channels
+author: Audrey Tang <cpan at audreyt.org>
+distribution_type: module
+generated_by: Module::Install version 0.64
+license: MIT
+name: IPC-PubSub
+no_index:
+ directory:
+ - inc
+ - t
+requires:
+ Class::Accessor::Fast: 0
+ DBM::Deep: 0
+ Data::UUID: 0
+ perl: 5.005
+version: 0.10
Added: IPC-PubSub/Makefile
==============================================================================
--- (empty file)
+++ IPC-PubSub/Makefile Wed Oct 25 12:21:07 2006
@@ -0,0 +1,846 @@
+# This Makefile is for the IPC::PubSub extension to perl.
+#
+# It was generated automatically by MakeMaker version
+# 6.30 (Revision: Revision: 4535 ) from the contents of
+# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
+#
+# ANY CHANGES MADE HERE WILL BE LOST!
+#
+# MakeMaker ARGV: ()
+#
+# MakeMaker Parameters:
+
+# ABSTRACT => q[Interprocess Publish/Subscribe channels]
+# AUTHOR => q[Audrey Tang <cpan at audreyt.org>]
+# DIR => []
+# DISTNAME => q[IPC-PubSub]
+# NAME => q[IPC::PubSub]
+# NO_META => q[1]
+# PL_FILES => { }
+# PREREQ_PM => { DBM::Deep=>q[0], Class::Accessor::Fast=>q[0], Data::UUID=>q[0] }
+# SIGN => q[1]
+# VERSION => q[0.10]
+# dist => { PREOP=>q[$(PERL) -I. -MModule::Install::Admin -e "dist_preop(q($(DISTVNAME)))"] }
+
+# --- MakeMaker post_initialize section:
+
+
+# --- MakeMaker const_config section:
+
+# These definitions are from config.sh (via /opt/local/lib/perl5/5.8.8/darwin-2level/Config.pm)
+
+# They may have been overridden via Makefile.PL or on the command line
+AR = ar
+CC = /usr/bin/gcc-4.0
+CCCDLFLAGS =
+CCDLFLAGS =
+DLEXT = bundle
+DLSRC = dl_dlopen.xs
+LD = env MACOSX_DEPLOYMENT_TARGET=10.3 cc
+LDDLFLAGS = -L/opt/local/lib -bundle -undefined dynamic_lookup
+LDFLAGS = -L/opt/local/lib
+LIBC = /usr/lib/libc.dylib
+LIB_EXT = .a
+OBJ_EXT = .o
+OSNAME = darwin
+OSVERS = 8.6.2
+RANLIB = ranlib
+SITELIBEXP = /opt/local/lib/perl5/site_perl/5.8.8
+SITEARCHEXP = /opt/local/lib/perl5/site_perl/5.8.8/darwin-2level
+SO = dylib
+EXE_EXT =
+FULL_AR = /usr/bin/ar
+VENDORARCHEXP = /opt/local/lib/perl5/vendor_perl/5.8.8/darwin-2level
+VENDORLIBEXP = /opt/local/lib/perl5/vendor_perl/5.8.8
+
+
+# --- MakeMaker constants section:
+AR_STATIC_ARGS = cr
+DIRFILESEP = /
+DFSEP = $(DIRFILESEP)
+NAME = IPC::PubSub
+NAME_SYM = IPC_PubSub
+VERSION = 0.10
+VERSION_MACRO = VERSION
+VERSION_SYM = 0_10
+DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
+XS_VERSION = 0.10
+XS_VERSION_MACRO = XS_VERSION
+XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
+INST_ARCHLIB = blib/arch
+INST_SCRIPT = blib/script
+INST_BIN = blib/bin
+INST_LIB = blib/lib
+INST_MAN1DIR = blib/man1
+INST_MAN3DIR = blib/man3
+MAN1EXT = 1
+MAN3EXT = 3
+INSTALLDIRS = site
+DESTDIR =
+PREFIX = $(SITEPREFIX)
+PERLPREFIX = /opt/local
+SITEPREFIX = /opt/local
+VENDORPREFIX = /opt/local
+INSTALLPRIVLIB = /opt/local/lib/perl5/5.8.8
+DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB)
+INSTALLSITELIB = /opt/local/lib/perl5/site_perl/5.8.8
+DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB)
+INSTALLVENDORLIB = /opt/local/lib/perl5/vendor_perl/5.8.8
+DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB)
+INSTALLARCHLIB = /opt/local/lib/perl5/5.8.8/darwin-2level
+DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB)
+INSTALLSITEARCH = /opt/local/lib/perl5/site_perl/5.8.8/darwin-2level
+DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH)
+INSTALLVENDORARCH = /opt/local/lib/perl5/vendor_perl/5.8.8/darwin-2level
+DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH)
+INSTALLBIN = /opt/local/bin
+DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN)
+INSTALLSITEBIN = /opt/local/bin
+DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN)
+INSTALLVENDORBIN = /opt/local/bin
+DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN)
+INSTALLSCRIPT = /opt/local/bin
+DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT)
+INSTALLMAN1DIR = /opt/local/share/man/man1
+DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR)
+INSTALLSITEMAN1DIR = /opt/local/share/man/man1
+DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR)
+INSTALLVENDORMAN1DIR = /opt/local/share/man/man1
+DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR)
+INSTALLMAN3DIR = /opt/local/share/man/man3
+DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR)
+INSTALLSITEMAN3DIR = /opt/local/share/man/man3
+DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR)
+INSTALLVENDORMAN3DIR = /opt/local/share/man/man3
+DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR)
+PERL_LIB =
+PERL_ARCHLIB = /opt/local/lib/perl5/5.8.8/darwin-2level
+LIBPERL_A = libperl.a
+FIRST_MAKEFILE = Makefile
+MAKEFILE_OLD = Makefile.old
+MAKE_APERL_FILE = Makefile.aperl
+PERLMAINCC = $(CC)
+PERL_INC = /opt/local/lib/perl5/5.8.8/darwin-2level/CORE
+PERL = /opt/local/bin/perl "-Iinc"
+FULLPERL = /opt/local/bin/perl "-Iinc"
+ABSPERL = $(PERL)
+PERLRUN = $(PERL)
+FULLPERLRUN = $(FULLPERL)
+ABSPERLRUN = $(ABSPERL)
+PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-Iinc" "-I$(INST_LIB)"
+FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-Iinc" "-I$(INST_LIB)"
+ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-Iinc" "-I$(INST_LIB)"
+PERL_CORE = 0
+PERM_RW = 644
+PERM_RWX = 755
+
+MAKEMAKER = /opt/local/lib/perl5/5.8.8/ExtUtils/MakeMaker.pm
+MM_VERSION = 6.30
+MM_REVISION = Revision: 4535
+
+# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
+# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
+# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
+# DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
+FULLEXT = IPC/PubSub
+BASEEXT = PubSub
+PARENT_NAME = IPC
+DLBASE = $(BASEEXT)
+VERSION_FROM =
+OBJECT =
+LDFROM = $(OBJECT)
+LINKTYPE = dynamic
+BOOTDEP =
+
+# Handy lists of source code files:
+XS_FILES =
+C_FILES =
+O_FILES =
+H_FILES =
+MAN1PODS =
+MAN3PODS = lib/IPC/PubSub.pm
+
+# Where is the Config information that we are using/depend on
+CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h
+
+# Where to build things
+INST_LIBDIR = $(INST_LIB)/IPC
+INST_ARCHLIBDIR = $(INST_ARCHLIB)/IPC
+
+INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT)
+INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
+
+INST_STATIC =
+INST_DYNAMIC =
+INST_BOOT =
+
+# Extra linker info
+EXPORT_LIST =
+PERL_ARCHIVE =
+PERL_ARCHIVE_AFTER =
+
+
+TO_INST_PM = lib/IPC/PubSub.pm \
+ lib/IPC/PubSub/Cache/DBM_Deep.pm \
+ lib/IPC/PubSub/Cache/JiftyDBI.pm \
+ lib/IPC/PubSub/Cache/JiftyDBI/Stash.pm \
+ lib/IPC/PubSub/Cache/JiftyDBI/Stash/Item.pm \
+ lib/IPC/PubSub/Cache/JiftyDBI/Stash/Publisher.pm \
+ lib/IPC/PubSub/Cache/Memcached.pm \
+ lib/IPC/PubSub/Cache/PlainHash.pm \
+ lib/IPC/PubSub/Cacheable.pm \
+ lib/IPC/PubSub/Publisher.pm \
+ lib/IPC/PubSub/Subscriber.pm
+
+PM_TO_BLIB = lib/IPC/PubSub/Publisher.pm \
+ blib/lib/IPC/PubSub/Publisher.pm \
+ lib/IPC/PubSub/Cache/DBM_Deep.pm \
+ blib/lib/IPC/PubSub/Cache/DBM_Deep.pm \
+ lib/IPC/PubSub.pm \
+ blib/lib/IPC/PubSub.pm \
+ lib/IPC/PubSub/Cache/Memcached.pm \
+ blib/lib/IPC/PubSub/Cache/Memcached.pm \
+ lib/IPC/PubSub/Cache/PlainHash.pm \
+ blib/lib/IPC/PubSub/Cache/PlainHash.pm \
+ lib/IPC/PubSub/Subscriber.pm \
+ blib/lib/IPC/PubSub/Subscriber.pm \
+ lib/IPC/PubSub/Cache/JiftyDBI/Stash/Publisher.pm \
+ blib/lib/IPC/PubSub/Cache/JiftyDBI/Stash/Publisher.pm \
+ lib/IPC/PubSub/Cache/JiftyDBI/Stash.pm \
+ blib/lib/IPC/PubSub/Cache/JiftyDBI/Stash.pm \
+ lib/IPC/PubSub/Cacheable.pm \
+ blib/lib/IPC/PubSub/Cacheable.pm \
+ lib/IPC/PubSub/Cache/JiftyDBI/Stash/Item.pm \
+ blib/lib/IPC/PubSub/Cache/JiftyDBI/Stash/Item.pm \
+ lib/IPC/PubSub/Cache/JiftyDBI.pm \
+ blib/lib/IPC/PubSub/Cache/JiftyDBI.pm
+
+
+# --- MakeMaker platform_constants section:
+MM_Unix_VERSION = 1.50
+PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
+
+
+# --- MakeMaker tool_autosplit section:
+# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
+AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)'
+
+
+
+# --- MakeMaker tool_xsubpp section:
+
+
+# --- MakeMaker tools_other section:
+SHELL = /bin/sh
+CHMOD = chmod
+CP = cp
+MV = mv
+NOOP = $(SHELL) -c true
+NOECHO = @
+RM_F = rm -f
+RM_RF = rm -rf
+TEST_F = test -f
+TOUCH = touch
+UMASK_NULL = umask 0
+DEV_NULL = > /dev/null 2>&1
+MKPATH = $(ABSPERLRUN) "-MExtUtils::Command" -e mkpath
+EQUALIZE_TIMESTAMP = $(ABSPERLRUN) "-MExtUtils::Command" -e eqtime
+ECHO = echo
+ECHO_N = echo -n
+UNINST = 0
+VERBINST = 0
+MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install({@ARGV}, '\''$(VERBINST)'\'', 0, '\''$(UNINST)'\'');'
+DOC_INSTALL = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e perllocal_install
+UNINSTALL = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e uninstall
+WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist
+MACROSTART =
+MACROEND =
+USEMAKEFILE = -f
+FIXIN = $(PERLRUN) "-MExtUtils::MY" -e "MY->fixin(shift)"
+
+
+# --- MakeMaker makemakerdflt section:
+makemakerdflt: all
+ $(NOECHO) $(NOOP)
+
+
+# --- MakeMaker dist section:
+TAR = tar
+TARFLAGS = cvf
+ZIP = zip
+ZIPFLAGS = -r
+COMPRESS = gzip --best
+SUFFIX = .gz
+SHAR = shar
+PREOP = $(PERL) -I. -MModule::Install::Admin -e "dist_preop(q($(DISTVNAME)))"
+POSTOP = $(NOECHO) $(NOOP)
+TO_UNIX = $(NOECHO) $(NOOP)
+CI = ci -u
+RCS_LABEL = rcs -Nv$(VERSION_SYM): -q
+DIST_CP = best
+DIST_DEFAULT = tardist
+DISTNAME = IPC-PubSub
+DISTVNAME = IPC-PubSub-0.10
+
+
+# --- MakeMaker macro section:
+
+
+# --- MakeMaker depend section:
+
+
+# --- MakeMaker cflags section:
+
+
+# --- MakeMaker const_loadlibs section:
+
+
+# --- MakeMaker const_cccmd section:
+
+
+# --- MakeMaker post_constants section:
+
+
+# --- MakeMaker pasthru section:
+
+PASTHRU = LIBPERL_A="$(LIBPERL_A)"\
+ LINKTYPE="$(LINKTYPE)"\
+ PREFIX="$(PREFIX)"
+
+
+# --- MakeMaker special_targets section:
+.SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT)
+
+.PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir
+
+
+
+# --- MakeMaker c_o section:
+
+
+# --- MakeMaker xs_c section:
+
+
+# --- MakeMaker xs_o section:
+
+
+# --- MakeMaker top_targets section:
+all :: pure_all manifypods
+ $(NOECHO) $(NOOP)
+
+
+pure_all :: config pm_to_blib subdirs linkext
+ $(NOECHO) $(NOOP)
+
+subdirs :: $(MYEXTLIB)
+ $(NOECHO) $(NOOP)
+
+config :: $(FIRST_MAKEFILE) blibdirs
+ $(NOECHO) $(NOOP)
+
+help :
+ perldoc ExtUtils::MakeMaker
+
+
+# --- MakeMaker blibdirs section:
+blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists
+ $(NOECHO) $(NOOP)
+
+# Backwards compat with 6.18 through 6.25
+blibdirs.ts : blibdirs
+ $(NOECHO) $(NOOP)
+
+$(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL
+ $(NOECHO) $(MKPATH) $(INST_LIBDIR)
+ $(NOECHO) $(CHMOD) 755 $(INST_LIBDIR)
+ $(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists
+
+$(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL
+ $(NOECHO) $(MKPATH) $(INST_ARCHLIB)
+ $(NOECHO) $(CHMOD) 755 $(INST_ARCHLIB)
+ $(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists
+
+$(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL
+ $(NOECHO) $(MKPATH) $(INST_AUTODIR)
+ $(NOECHO) $(CHMOD) 755 $(INST_AUTODIR)
+ $(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists
+
+$(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL
+ $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR)
+ $(NOECHO) $(CHMOD) 755 $(INST_ARCHAUTODIR)
+ $(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists
+
+$(INST_BIN)$(DFSEP).exists :: Makefile.PL
+ $(NOECHO) $(MKPATH) $(INST_BIN)
+ $(NOECHO) $(CHMOD) 755 $(INST_BIN)
+ $(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists
+
+$(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL
+ $(NOECHO) $(MKPATH) $(INST_SCRIPT)
+ $(NOECHO) $(CHMOD) 755 $(INST_SCRIPT)
+ $(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists
+
+$(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL
+ $(NOECHO) $(MKPATH) $(INST_MAN1DIR)
+ $(NOECHO) $(CHMOD) 755 $(INST_MAN1DIR)
+ $(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists
+
+$(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL
+ $(NOECHO) $(MKPATH) $(INST_MAN3DIR)
+ $(NOECHO) $(CHMOD) 755 $(INST_MAN3DIR)
+ $(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists
+
+
+
+# --- MakeMaker linkext section:
+
+linkext :: $(LINKTYPE)
+ $(NOECHO) $(NOOP)
+
+
+# --- MakeMaker dlsyms section:
+
+
+# --- MakeMaker dynamic section:
+
+dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT)
+ $(NOECHO) $(NOOP)
+
+
+# --- MakeMaker dynamic_bs section:
+
+BOOTSTRAP =
+
+
+# --- MakeMaker dynamic_lib section:
+
+
+# --- MakeMaker static section:
+
+## $(INST_PM) has been moved to the all: target.
+## It remains here for awhile to allow for old usage: "make static"
+static :: $(FIRST_MAKEFILE) $(INST_STATIC)
+ $(NOECHO) $(NOOP)
+
+
+# --- MakeMaker static_lib section:
+
+
+# --- MakeMaker manifypods section:
+
+POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--"
+POD2MAN = $(POD2MAN_EXE)
+
+
+manifypods : pure_all \
+ lib/IPC/PubSub.pm \
+ lib/IPC/PubSub.pm
+ $(NOECHO) $(POD2MAN) --section=3 --perm_rw=$(PERM_RW) \
+ lib/IPC/PubSub.pm $(INST_MAN3DIR)/IPC::PubSub.$(MAN3EXT)
+
+
+
+
+# --- MakeMaker processPL section:
+
+
+# --- MakeMaker installbin section:
+
+
+# --- MakeMaker subdirs section:
+
+# none
+
+# --- MakeMaker clean_subdirs section:
+clean_subdirs :
+ $(NOECHO) $(NOOP)
+
+
+# --- MakeMaker clean section:
+
+# Delete temporary files but do not touch installed files. We don't delete
+# the Makefile here so a later make realclean still has a makefile to use.
+
+clean :: clean_subdirs
+ - $(RM_F) \
+ *$(LIB_EXT) core \
+ core.[0-9] $(INST_ARCHAUTODIR)/extralibs.all \
+ core.[0-9][0-9] $(BASEEXT).bso \
+ pm_to_blib.ts core.[0-9][0-9][0-9][0-9] \
+ $(BASEEXT).x $(BOOTSTRAP) \
+ perl$(EXE_EXT) tmon.out \
+ *$(OBJ_EXT) pm_to_blib \
+ $(INST_ARCHAUTODIR)/extralibs.ld blibdirs.ts \
+ core.[0-9][0-9][0-9][0-9][0-9] *perl.core \
+ core.*perl.*.? $(MAKE_APERL_FILE) \
+ perl $(BASEEXT).def \
+ core.[0-9][0-9][0-9] mon.out \
+ lib$(BASEEXT).def perlmain.c \
+ perl.exe so_locations \
+ $(BASEEXT).exp
+ - $(RM_RF) \
+ blib
+ - $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL)
+
+
+# --- MakeMaker realclean_subdirs section:
+realclean_subdirs :
+ $(NOECHO) $(NOOP)
+
+
+# --- MakeMaker realclean section:
+# Delete temporary files (via clean) and also delete dist files
+realclean purge :: clean realclean_subdirs
+ - $(RM_F) \
+ $(MAKEFILE_OLD) $(FIRST_MAKEFILE)
+ - $(RM_RF) \
+ $(DISTVNAME)
+
+
+# --- MakeMaker metafile section:
+metafile:
+ $(NOECHO) $(NOOP)
+
+
+# --- MakeMaker signature section:
+signature :
+ cpansign -s
+
+
+# --- MakeMaker dist_basics section:
+distclean :: realclean distcheck
+ $(NOECHO) $(NOOP)
+
+distcheck :
+ $(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck
+
+skipcheck :
+ $(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck
+
+manifest :
+ $(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest
+
+veryclean : realclean
+ $(RM_F) *~ *.orig */*~ */*.orig
+
+
+
+# --- MakeMaker dist_core section:
+
+dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE)
+ $(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \
+ -e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';'
+
+tardist : $(DISTVNAME).tar$(SUFFIX)
+ $(NOECHO) $(NOOP)
+
+uutardist : $(DISTVNAME).tar$(SUFFIX)
+ uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu
+
+$(DISTVNAME).tar$(SUFFIX) : distdir
+ $(PREOP)
+ $(TO_UNIX)
+ $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
+ $(RM_RF) $(DISTVNAME)
+ $(COMPRESS) $(DISTVNAME).tar
+ $(POSTOP)
+
+zipdist : $(DISTVNAME).zip
+ $(NOECHO) $(NOOP)
+
+$(DISTVNAME).zip : distdir
+ $(PREOP)
+ $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
+ $(RM_RF) $(DISTVNAME)
+ $(POSTOP)
+
+shdist : distdir
+ $(PREOP)
+ $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
+ $(RM_RF) $(DISTVNAME)
+ $(POSTOP)
+
+
+# --- MakeMaker distdir section:
+create_distdir :
+ $(RM_RF) $(DISTVNAME)
+ $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \
+ -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
+
+distdir : create_distdir distsignature
+ $(NOECHO) $(NOOP)
+
+
+
+# --- MakeMaker dist_test section:
+disttest : distdir
+ cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL
+ cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
+ cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
+
+
+
+# --- MakeMaker dist_ci section:
+
+ci :
+ $(PERLRUN) "-MExtUtils::Manifest=maniread" \
+ -e "@all = keys %{ maniread() };" \
+ -e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \
+ -e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});"
+
+
+# --- MakeMaker distmeta section:
+distmeta : create_distdir metafile
+ $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } ' \
+ -e ' or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"'
+
+
+
+# --- MakeMaker distsignature section:
+distsignature : create_distdir
+ $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } ' \
+ -e ' or print "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}\n"'
+ $(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE
+ cd $(DISTVNAME) && cpansign -s
+
+
+
+# --- MakeMaker install section:
+
+install :: all pure_install doc_install
+ $(NOECHO) $(NOOP)
+
+install_perl :: all pure_perl_install doc_perl_install
+ $(NOECHO) $(NOOP)
+
+install_site :: all pure_site_install doc_site_install
+ $(NOECHO) $(NOOP)
+
+install_vendor :: all pure_vendor_install doc_vendor_install
+ $(NOECHO) $(NOOP)
+
+pure_install :: pure_$(INSTALLDIRS)_install
+ $(NOECHO) $(NOOP)
+
+doc_install :: doc_$(INSTALLDIRS)_install
+ $(NOECHO) $(NOOP)
+
+pure__install : pure_site_install
+ $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
+
+doc__install : doc_site_install
+ $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
+
+pure_perl_install ::
+ $(NOECHO) $(MOD_INSTALL) \
+ read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \
+ write $(DESTINSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \
+ $(INST_LIB) $(DESTINSTALLPRIVLIB) \
+ $(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \
+ $(INST_BIN) $(DESTINSTALLBIN) \
+ $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
+ $(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \
+ $(INST_MAN3DIR) $(DESTINSTALLMAN3DIR)
+ $(NOECHO) $(WARN_IF_OLD_PACKLIST) \
+ $(SITEARCHEXP)/auto/$(FULLEXT)
+
+
+pure_site_install ::
+ $(NOECHO) $(MOD_INSTALL) \
+ read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \
+ write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \
+ $(INST_LIB) $(DESTINSTALLSITELIB) \
+ $(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \
+ $(INST_BIN) $(DESTINSTALLSITEBIN) \
+ $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
+ $(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \
+ $(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR)
+ $(NOECHO) $(WARN_IF_OLD_PACKLIST) \
+ $(PERL_ARCHLIB)/auto/$(FULLEXT)
+
+pure_vendor_install ::
+ $(NOECHO) $(MOD_INSTALL) \
+ read $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist \
+ write $(DESTINSTALLVENDORARCH)/auto/$(FULLEXT)/.packlist \
+ $(INST_LIB) $(DESTINSTALLVENDORLIB) \
+ $(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \
+ $(INST_BIN) $(DESTINSTALLVENDORBIN) \
+ $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
+ $(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \
+ $(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR)
+
+doc_perl_install ::
+ $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
+ -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
+ -$(NOECHO) $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" "$(INSTALLPRIVLIB)" \
+ LINKTYPE "$(LINKTYPE)" \
+ VERSION "$(VERSION)" \
+ EXE_FILES "$(EXE_FILES)" \
+ >> $(DESTINSTALLARCHLIB)/perllocal.pod
+
+doc_site_install ::
+ $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
+ -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
+ -$(NOECHO) $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" "$(INSTALLSITELIB)" \
+ LINKTYPE "$(LINKTYPE)" \
+ VERSION "$(VERSION)" \
+ EXE_FILES "$(EXE_FILES)" \
+ >> $(DESTINSTALLARCHLIB)/perllocal.pod
+
+doc_vendor_install ::
+ $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
+ -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
+ -$(NOECHO) $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" "$(INSTALLVENDORLIB)" \
+ LINKTYPE "$(LINKTYPE)" \
+ VERSION "$(VERSION)" \
+ EXE_FILES "$(EXE_FILES)" \
+ >> $(DESTINSTALLARCHLIB)/perllocal.pod
+
+
+uninstall :: uninstall_from_$(INSTALLDIRS)dirs
+ $(NOECHO) $(NOOP)
+
+uninstall_from_perldirs ::
+ $(NOECHO) $(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist
+
+uninstall_from_sitedirs ::
+ $(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist
+
+uninstall_from_vendordirs ::
+ $(NOECHO) $(UNINSTALL) $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist
+
+
+# --- MakeMaker force section:
+# Phony target to force checking subdirectories.
+FORCE:
+ $(NOECHO) $(NOOP)
+
+
+# --- MakeMaker perldepend section:
+
+
+# --- MakeMaker makefile section:
+# We take a very conservative approach here, but it's worth it.
+# We move Makefile to Makefile.old here to avoid gnu make looping.
+$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
+ $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?"
+ $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..."
+ -$(NOECHO) $(RM_F) $(MAKEFILE_OLD)
+ -$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD)
+ - $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL)
+ $(PERLRUN) Makefile.PL
+ $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <=="
+ $(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <=="
+ false
+
+
+
+# --- MakeMaker staticmake section:
+
+# --- MakeMaker makeaperl section ---
+MAP_TARGET = perl
+FULLPERL = /opt/local/bin/perl
+
+$(MAP_TARGET) :: static $(MAKE_APERL_FILE)
+ $(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@
+
+$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib
+ $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
+ $(NOECHO) $(PERLRUNINST) \
+ Makefile.PL DIR= \
+ MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
+ MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=
+
+
+# --- MakeMaker test section:
+
+TEST_VERBOSE=0
+TEST_TYPE=test_$(LINKTYPE)
+TEST_FILE = test.pl
+TEST_FILES = t/*.t
+TESTDB_SW = -d
+
+testdb :: testdb_$(LINKTYPE)
+
+test :: $(TEST_TYPE)
+
+test_dynamic :: pure_all
+ PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), 'inc', '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)
+
+testdb_dynamic :: pure_all
+ PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-Iinc" "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
+
+test_ : test_dynamic
+
+test_static :: test_dynamic
+testdb_static :: testdb_dynamic
+
+
+# --- MakeMaker ppd section:
+# Creates a PPD (Perl Package Description) for a binary distribution.
+ppd:
+ $(NOECHO) $(ECHO) '<SOFTPKG NAME="$(DISTNAME)" VERSION="0,10,0,0">' > $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) ' <TITLE>$(DISTNAME)</TITLE>' >> $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) ' <ABSTRACT>Interprocess Publish/Subscribe channels</ABSTRACT>' >> $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) ' <AUTHOR>Audrey Tang <cpan at audreyt.org></AUTHOR>' >> $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) ' <IMPLEMENTATION>' >> $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) ' <DEPENDENCY NAME="Class-Accessor-Fast" VERSION="0,0,0,0" />' >> $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) ' <DEPENDENCY NAME="DBM-Deep" VERSION="0,0,0,0" />' >> $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) ' <DEPENDENCY NAME="Data-UUID" VERSION="0,0,0,0" />' >> $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) ' <OS NAME="$(OSNAME)" />' >> $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) ' <ARCHITECTURE NAME="darwin-2level" />' >> $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) ' <CODEBASE HREF="" />' >> $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) ' </IMPLEMENTATION>' >> $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) '</SOFTPKG>' >> $(DISTNAME).ppd
+
+
+# --- MakeMaker pm_to_blib section:
+
+pm_to_blib : $(TO_INST_PM)
+ $(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', '\''$(PM_FILTER)'\'')' \
+ lib/IPC/PubSub/Publisher.pm blib/lib/IPC/PubSub/Publisher.pm \
+ lib/IPC/PubSub/Cache/DBM_Deep.pm blib/lib/IPC/PubSub/Cache/DBM_Deep.pm \
+ lib/IPC/PubSub.pm blib/lib/IPC/PubSub.pm \
+ lib/IPC/PubSub/Cache/Memcached.pm blib/lib/IPC/PubSub/Cache/Memcached.pm \
+ lib/IPC/PubSub/Cache/PlainHash.pm blib/lib/IPC/PubSub/Cache/PlainHash.pm \
+ lib/IPC/PubSub/Subscriber.pm blib/lib/IPC/PubSub/Subscriber.pm \
+ lib/IPC/PubSub/Cache/JiftyDBI/Stash/Publisher.pm blib/lib/IPC/PubSub/Cache/JiftyDBI/Stash/Publisher.pm \
+ lib/IPC/PubSub/Cache/JiftyDBI/Stash.pm blib/lib/IPC/PubSub/Cache/JiftyDBI/Stash.pm \
+ lib/IPC/PubSub/Cacheable.pm blib/lib/IPC/PubSub/Cacheable.pm \
+ lib/IPC/PubSub/Cache/JiftyDBI/Stash/Item.pm blib/lib/IPC/PubSub/Cache/JiftyDBI/Stash/Item.pm \
+ lib/IPC/PubSub/Cache/JiftyDBI.pm blib/lib/IPC/PubSub/Cache/JiftyDBI.pm
+ $(NOECHO) $(TOUCH) pm_to_blib
+
+
+# --- MakeMaker selfdocument section:
+
+
+# --- MakeMaker postamble section:
+
+
+# End.
+# Postamble by Module::Install 0.64
+# --- Module::Install::Admin::Makefile section:
+
+realclean purge ::
+ $(RM_F) $(DISTVNAME).tar$(SUFFIX)
+ $(RM_RF) inc MANIFEST.bak _build
+ $(PERL) -I. -MModule::Install::Admin -e "remove_meta()"
+
+reset :: purge
+
+upload :: test dist
+ cpan-upload -verbose $(DISTVNAME).tar$(SUFFIX)
+
+grok ::
+ perldoc Module::Install
+
+distsign ::
+ cpansign -s
+
Added: IPC-PubSub/Makefile.PL
==============================================================================
--- (empty file)
+++ IPC-PubSub/Makefile.PL Wed Oct 25 12:21:07 2006
@@ -0,0 +1,12 @@
+use strict;
+use inc::Module::Install;
+
+name 'IPC-PubSub';
+license 'MIT';
+all_from 'lib/IPC/PubSub.pm';
+
+requires 'DBM::Deep';
+requires 'Data::UUID';
+requires 'Class::Accessor::Fast';
+
+sign; WriteAll;
Added: IPC-PubSub/README
==============================================================================
--- (empty file)
+++ IPC-PubSub/README Wed Oct 25 12:21:07 2006
@@ -0,0 +1,106 @@
+NAME
+ IPC::PubSub - Interprocess Publish/Subscribe channels
+
+SYNOPSIS
+ # A new message bus with the DBM::Deep backend
+ # (Other possible backends include Memcached and PlainHash)
+ my $bus = IPC::PubSub->new(DBM_Deep => '/tmp/pubsub.db');
+
+ # A channel is any arbitrary string
+ my $channel = '#perl6';
+
+ # Register a new publisher (you can publish to multiple channels)
+ my $pub = $bus->new_publisher("#perl6", "#moose");
+
+ # Publish a message (may be a complex object) to those channels
+ $pub->msg("This is a message");
+
+ # Register a new subscriber (you can subscribe to multiple channels)
+ my $sub = $bus->new_subscriber("#moose");
+
+ # Publish an object to channels
+ $pub->msg("This is another message");
+
+ # Set all subsequent messages from this publisher to expire in 30 seconds
+ $pub->expiry(30);
+ $pub->msg("This message will go away in 30 seconds");
+
+ # Simple get: Returns the messages sent since the previous get,
+ # but only for the first channel.
+ my @msgs = $sub->get;
+
+ # Simple get, with an explicit channel key (must be among the ones
+ # it initially subscribed to)
+ my @moose_msgs = $sub->get("#moose");
+
+ # Complex get: Returns a hash reference from channels to array
+ # references of [timestamp, message].
+ my $hash_ref = $sub->get_all;
+
+ # Changing the list of channels we subscribe to
+ $sub->subscribe('some-other-channel');
+ $sub->unsubscribe('some-other-channel');
+
+ # Changing the list of channels we publish to
+ $pub->publish('some-other-channel');
+ $pub->unpublish('some-other-channel');
+
+ # Listing and checking if we are in a channel
+ my @sub_channels = $sub->channels;
+ my @pub_channels = $pub->channels;
+ print "Sub is in #moose" if $sub->channels->{'#moose'};
+ print "Pub is in #moose" if $pub->channels->{'#moose'};
+
+ # Raw APIs to manipulate the cache
+ $bus->lock('channel');
+ $bus->unlock('channel');
+ my @timed_msgs = $bus->fetch('key1', 'key2', 'key3');
+ $bus->store('key', 'value', time, 30);
+
+DESCRIPTION
+ This module provides a simple API for publishing messages to *channels*
+ and for subscribing to them.
+
+ When a *message* is published on a channel, all subscribers currently in
+ that channel will get it on their next "get" or "get_all" call.
+
+ Currently, it offers three backends: "DBM_Deep" for on-disk storage,
+ "Memcached" for possibly multi-host storage, and "PlainHash" for
+ single-process storage.
+
+ Please see the tests in t/ for this distribution, as well as "SYNOPSIS"
+ above, for some usage examples; detailed documentation is not yet
+ available.
+
+SEE ALSO
+ IPC::DirQueue, where the subscribers divide the published messages among
+ themselves, so different subscribers never see the same message.
+
+AUTHORS
+ Audrey Tang <cpan at audreyt.org>
+
+COPYRIGHT
+ Copyright 2006 by Audrey Tang <cpan at audreyt.org>.
+
+ This software is released under the MIT license cited below.
+
+ The "MIT" License
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
Added: IPC-PubSub/inc/Module/Install.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/inc/Module/Install.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,281 @@
+#line 1
+package Module::Install;
+
+# For any maintainers:
+# The load order for Module::Install is a bit magic.
+# It goes something like this...
+#
+# IF ( host has Module::Install installed, creating author mode ) {
+# 1. Makefile.PL calls "use inc::Module::Install"
+# 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install
+# 3. The installed version of inc::Module::Install loads
+# 4. inc::Module::Install calls "require Module::Install"
+# 5. The ./inc/ version of Module::Install loads
+# } ELSE {
+# 1. Makefile.PL calls "use inc::Module::Install"
+# 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install
+# 3. The ./inc/ version of Module::Install loads
+# }
+
+use 5.004;
+use strict 'vars';
+
+use vars qw{$VERSION};
+BEGIN {
+ # All Module::Install core packages now require synchronised versions.
+ # This will be used to ensure we don't accidentally load old or
+ # different versions of modules.
+ # This is not enforced yet, but will be some time in the next few
+ # releases once we can make sure it won't clash with custom
+ # Module::Install extensions.
+ $VERSION = '0.64';
+}
+
+# Whether or not inc::Module::Install is actually loaded, the
+# $INC{inc/Module/Install.pm} is what will still get set as long as
+# the caller loaded module this in the documented manner.
+# If not set, the caller may NOT have loaded the bundled version, and thus
+# they may not have a MI version that works with the Makefile.PL. This would
+# result in false errors or unexpected behaviour. And we don't want that.
+my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
+unless ( $INC{$file} ) {
+ die <<"END_DIE";
+Please invoke ${\__PACKAGE__} with:
+
+ use inc::${\__PACKAGE__};
+
+not:
+
+ use ${\__PACKAGE__};
+
+END_DIE
+}
+
+# If the script that is loading Module::Install is from the future,
+# then make will detect this and cause it to re-run over and over
+# again. This is bad. Rather than taking action to touch it (which
+# is unreliable on some platforms and requires write permissions)
+# for now we should catch this and refuse to run.
+if ( -f $0 and (stat($0))[9] > time ) {
+ die << "END_DIE";
+Your installer $0 has a modification time in the future.
+
+This is known to create infinite loops in make.
+
+Please correct this, then run $0 again.
+
+END_DIE
+}
+
+use Cwd ();
+use File::Find ();
+use File::Path ();
+use FindBin;
+
+*inc::Module::Install::VERSION = *VERSION;
+ at inc::Module::Install::ISA = __PACKAGE__;
+
+sub autoload {
+ my $self = shift;
+ my $who = $self->_caller;
+ my $cwd = Cwd::cwd();
+ my $sym = "${who}::AUTOLOAD";
+ $sym->{$cwd} = sub {
+ my $pwd = Cwd::cwd();
+ if ( my $code = $sym->{$pwd} ) {
+ # delegate back to parent dirs
+ goto &$code unless $cwd eq $pwd;
+ }
+ $$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
+ unshift @_, ($self, $1);
+ goto &{$self->can('call')} unless uc($1) eq $1;
+ };
+}
+
+sub import {
+ my $class = shift;
+ my $self = $class->new(@_);
+ my $who = $self->_caller;
+
+ unless ( -f $self->{file} ) {
+ require "$self->{path}/$self->{dispatch}.pm";
+ File::Path::mkpath("$self->{prefix}/$self->{author}");
+ $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self );
+ $self->{admin}->init;
+ @_ = ($class, _self => $self);
+ goto &{"$self->{name}::import"};
+ }
+
+ *{"${who}::AUTOLOAD"} = $self->autoload;
+ $self->preload;
+
+ # Unregister loader and worker packages so subdirs can use them again
+ delete $INC{"$self->{file}"};
+ delete $INC{"$self->{path}.pm"};
+}
+
+sub preload {
+ my ($self) = @_;
+
+ unless ( $self->{extensions} ) {
+ $self->load_extensions(
+ "$self->{prefix}/$self->{path}", $self
+ );
+ }
+
+ my @exts = @{$self->{extensions}};
+ unless ( @exts ) {
+ my $admin = $self->{admin};
+ @exts = $admin->load_all_extensions;
+ }
+
+ my %seen;
+ foreach my $obj ( @exts ) {
+ while (my ($method, $glob) = each %{ref($obj) . '::'}) {
+ next unless $obj->can($method);
+ next if $method =~ /^_/;
+ next if $method eq uc($method);
+ $seen{$method}++;
+ }
+ }
+
+ my $who = $self->_caller;
+ foreach my $name ( sort keys %seen ) {
+ *{"${who}::$name"} = sub {
+ ${"${who}::AUTOLOAD"} = "${who}::$name";
+ goto &{"${who}::AUTOLOAD"};
+ };
+ }
+}
+
+sub new {
+ my ($class, %args) = @_;
+
+ # ignore the prefix on extension modules built from top level.
+ my $base_path = Cwd::abs_path($FindBin::Bin);
+ unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) {
+ delete $args{prefix};
+ }
+
+ return $args{_self} if $args{_self};
+
+ $args{dispatch} ||= 'Admin';
+ $args{prefix} ||= 'inc';
+ $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author');
+ $args{bundle} ||= 'inc/BUNDLES';
+ $args{base} ||= $base_path;
+ $class =~ s/^\Q$args{prefix}\E:://;
+ $args{name} ||= $class;
+ $args{version} ||= $class->VERSION;
+ unless ( $args{path} ) {
+ $args{path} = $args{name};
+ $args{path} =~ s!::!/!g;
+ }
+ $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
+
+ bless( \%args, $class );
+}
+
+sub call {
+ my ($self, $method) = @_;
+ my $obj = $self->load($method) or return;
+ splice(@_, 0, 2, $obj);
+ goto &{$obj->can($method)};
+}
+
+sub load {
+ my ($self, $method) = @_;
+
+ $self->load_extensions(
+ "$self->{prefix}/$self->{path}", $self
+ ) unless $self->{extensions};
+
+ foreach my $obj (@{$self->{extensions}}) {
+ return $obj if $obj->can($method);
+ }
+
+ my $admin = $self->{admin} or die <<"END_DIE";
+The '$method' method does not exist in the '$self->{prefix}' path!
+Please remove the '$self->{prefix}' directory and run $0 again to load it.
+END_DIE
+
+ my $obj = $admin->load($method, 1);
+ push @{$self->{extensions}}, $obj;
+
+ $obj;
+}
+
+sub load_extensions {
+ my ($self, $path, $top) = @_;
+
+ unless ( grep { lc $_ eq lc $self->{prefix} } @INC ) {
+ unshift @INC, $self->{prefix};
+ }
+
+ foreach my $rv ( $self->find_extensions($path) ) {
+ my ($file, $pkg) = @{$rv};
+ next if $self->{pathnames}{$pkg};
+
+ local $@;
+ my $new = eval { require $file; $pkg->can('new') };
+ unless ( $new ) {
+ warn $@ if $@;
+ next;
+ }
+ $self->{pathnames}{$pkg} = delete $INC{$file};
+ push @{$self->{extensions}}, &{$new}($pkg, _top => $top );
+ }
+
+ $self->{extensions} ||= [];
+}
+
+sub find_extensions {
+ my ($self, $path) = @_;
+
+ my @found;
+ File::Find::find( sub {
+ my $file = $File::Find::name;
+ return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
+ my $subpath = $1;
+ return if lc($subpath) eq lc($self->{dispatch});
+
+ $file = "$self->{path}/$subpath.pm";
+ my $pkg = "$self->{name}::$subpath";
+ $pkg =~ s!/!::!g;
+
+ # If we have a mixed-case package name, assume case has been preserved
+ # correctly. Otherwise, root through the file to locate the case-preserved
+ # version of the package name.
+ if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
+ open PKGFILE, "<$subpath.pm" or die "find_extensions: Can't open $subpath.pm: $!";
+ my $in_pod = 0;
+ while ( <PKGFILE> ) {
+ $in_pod = 1 if /^=\w/;
+ $in_pod = 0 if /^=cut/;
+ next if ($in_pod || /^=cut/); # skip pod text
+ next if /^\s*#/; # and comments
+ if ( m/^\s*package\s+($pkg)\s*;/i ) {
+ $pkg = $1;
+ last;
+ }
+ }
+ close PKGFILE;
+ }
+
+ push @found, [ $file, $pkg ];
+ }, $path ) if -d $path;
+
+ @found;
+}
+
+sub _caller {
+ my $depth = 0;
+ my $call = caller($depth);
+ while ( $call eq __PACKAGE__ ) {
+ $depth++;
+ $call = caller($depth);
+ }
+ return $call;
+}
+
+1;
Added: IPC-PubSub/inc/Module/Install/Base.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/inc/Module/Install/Base.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,70 @@
+#line 1
+package Module::Install::Base;
+
+$VERSION = '0.64';
+
+# Suspend handler for "redefined" warnings
+BEGIN {
+ my $w = $SIG{__WARN__};
+ $SIG{__WARN__} = sub { $w };
+}
+
+### This is the ONLY module that shouldn't have strict on
+# use strict;
+
+#line 41
+
+sub new {
+ my ($class, %args) = @_;
+
+ foreach my $method ( qw(call load) ) {
+ *{"$class\::$method"} = sub {
+ shift()->_top->$method(@_);
+ } unless defined &{"$class\::$method"};
+ }
+
+ bless( \%args, $class );
+}
+
+#line 61
+
+sub AUTOLOAD {
+ my $self = shift;
+ local $@;
+ my $autoload = eval { $self->_top->autoload } or return;
+ goto &$autoload;
+}
+
+#line 76
+
+sub _top { $_[0]->{_top} }
+
+#line 89
+
+sub admin {
+ $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new;
+}
+
+sub is_admin {
+ $_[0]->admin->VERSION;
+}
+
+sub DESTROY {}
+
+package Module::Install::Base::FakeAdmin;
+
+my $Fake;
+sub new { $Fake ||= bless(\@_, $_[0]) }
+
+sub AUTOLOAD {}
+
+sub DESTROY {}
+
+# Restore warning handler
+BEGIN {
+ $SIG{__WARN__} = $SIG{__WARN__}->();
+}
+
+1;
+
+#line 138
Added: IPC-PubSub/inc/Module/Install/Can.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/inc/Module/Install/Can.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,82 @@
+#line 1
+package Module::Install::Can;
+
+use strict;
+use Module::Install::Base;
+use Config ();
+### This adds a 5.005 Perl version dependency.
+### This is a bug and will be fixed.
+use File::Spec ();
+use ExtUtils::MakeMaker ();
+
+use vars qw{$VERSION $ISCORE @ISA};
+BEGIN {
+ $VERSION = '0.64';
+ $ISCORE = 1;
+ @ISA = qw{Module::Install::Base};
+}
+
+# check if we can load some module
+### Upgrade this to not have to load the module if possible
+sub can_use {
+ my ($self, $mod, $ver) = @_;
+ $mod =~ s{::|\\}{/}g;
+ $mod .= '.pm' unless $mod =~ /\.pm$/i;
+
+ my $pkg = $mod;
+ $pkg =~ s{/}{::}g;
+ $pkg =~ s{\.pm$}{}i;
+
+ local $@;
+ eval { require $mod; $pkg->VERSION($ver || 0); 1 };
+}
+
+# check if we can run some command
+sub can_run {
+ my ($self, $cmd) = @_;
+
+ my $_cmd = $cmd;
+ return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
+
+ for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
+ my $abs = File::Spec->catfile($dir, $_[1]);
+ return $abs if (-x $abs or $abs = MM->maybe_command($abs));
+ }
+
+ return;
+}
+
+# can we locate a (the) C compiler
+sub can_cc {
+ my $self = shift;
+ my @chunks = split(/ /, $Config::Config{cc}) or return;
+
+ # $Config{cc} may contain args; try to find out the program part
+ while (@chunks) {
+ return $self->can_run("@chunks") || (pop(@chunks), next);
+ }
+
+ return;
+}
+
+# Fix Cygwin bug on maybe_command();
+if ( $^O eq 'cygwin' ) {
+ require ExtUtils::MM_Cygwin;
+ require ExtUtils::MM_Win32;
+ if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) {
+ *ExtUtils::MM_Cygwin::maybe_command = sub {
+ my ($self, $file) = @_;
+ if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
+ ExtUtils::MM_Win32->maybe_command($file);
+ } else {
+ ExtUtils::MM_Unix->maybe_command($file);
+ }
+ }
+ }
+}
+
+1;
+
+__END__
+
+#line 157
Added: IPC-PubSub/inc/Module/Install/Fetch.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/inc/Module/Install/Fetch.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,93 @@
+#line 1
+package Module::Install::Fetch;
+
+use strict;
+use Module::Install::Base;
+
+use vars qw{$VERSION $ISCORE @ISA};
+BEGIN {
+ $VERSION = '0.64';
+ $ISCORE = 1;
+ @ISA = qw{Module::Install::Base};
+}
+
+sub get_file {
+ my ($self, %args) = @_;
+ my ($scheme, $host, $path, $file) =
+ $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
+
+ if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) {
+ $args{url} = $args{ftp_url}
+ or (warn("LWP support unavailable!\n"), return);
+ ($scheme, $host, $path, $file) =
+ $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
+ }
+
+ $|++;
+ print "Fetching '$file' from $host... ";
+
+ unless (eval { require Socket; Socket::inet_aton($host) }) {
+ warn "'$host' resolve failed!\n";
+ return;
+ }
+
+ return unless $scheme eq 'ftp' or $scheme eq 'http';
+
+ require Cwd;
+ my $dir = Cwd::getcwd();
+ chdir $args{local_dir} or return if exists $args{local_dir};
+
+ if (eval { require LWP::Simple; 1 }) {
+ LWP::Simple::mirror($args{url}, $file);
+ }
+ elsif (eval { require Net::FTP; 1 }) { eval {
+ # use Net::FTP to get past firewall
+ my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
+ $ftp->login("anonymous", 'anonymous at example.com');
+ $ftp->cwd($path);
+ $ftp->binary;
+ $ftp->get($file) or (warn("$!\n"), return);
+ $ftp->quit;
+ } }
+ elsif (my $ftp = $self->can_run('ftp')) { eval {
+ # no Net::FTP, fallback to ftp.exe
+ require FileHandle;
+ my $fh = FileHandle->new;
+
+ local $SIG{CHLD} = 'IGNORE';
+ unless ($fh->open("|$ftp -n")) {
+ warn "Couldn't open ftp: $!\n";
+ chdir $dir; return;
+ }
+
+ my @dialog = split(/\n/, <<"END_FTP");
+open $host
+user anonymous anonymous\@example.com
+cd $path
+binary
+get $file $file
+quit
+END_FTP
+ foreach (@dialog) { $fh->print("$_\n") }
+ $fh->close;
+ } }
+ else {
+ warn "No working 'ftp' program available!\n";
+ chdir $dir; return;
+ }
+
+ unless (-f $file) {
+ warn "Fetching failed: $@\n";
+ chdir $dir; return;
+ }
+
+ return if exists $args{size} and -s $file != $args{size};
+ system($args{run}) if exists $args{run};
+ unlink($file) if $args{remove};
+
+ print(((!exists $args{check_for} or -e $args{check_for})
+ ? "done!" : "failed! ($!)"), "\n");
+ chdir $dir; return !$?;
+}
+
+1;
Added: IPC-PubSub/inc/Module/Install/Makefile.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/inc/Module/Install/Makefile.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,208 @@
+#line 1
+package Module::Install::Makefile;
+
+use strict 'vars';
+use Module::Install::Base;
+use ExtUtils::MakeMaker ();
+
+use vars qw{$VERSION $ISCORE @ISA};
+BEGIN {
+ $VERSION = '0.64';
+ $ISCORE = 1;
+ @ISA = qw{Module::Install::Base};
+}
+
+sub Makefile { $_[0] }
+
+my %seen = ();
+
+sub prompt {
+ shift;
+
+ # Infinite loop protection
+ my @c = caller();
+ if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
+ die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
+ }
+
+ # In automated testing, always use defaults
+ if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
+ local $ENV{PERL_MM_USE_DEFAULT} = 1;
+ goto &ExtUtils::MakeMaker::prompt;
+ } else {
+ goto &ExtUtils::MakeMaker::prompt;
+ }
+}
+
+sub makemaker_args {
+ my $self = shift;
+ my $args = ($self->{makemaker_args} ||= {});
+ %$args = ( %$args, @_ ) if @_;
+ $args;
+}
+
+# For mm args that take multiple space-seperated args,
+# append an argument to the current list.
+sub makemaker_append {
+ my $self = shift;
+ my $name = shift;
+ my $args = $self->makemaker_args;
+ $args->{name} = defined $args->{$name}
+ ? join( ' ', $args->{name}, @_ )
+ : join( ' ', @_ );
+}
+
+sub build_subdirs {
+ my $self = shift;
+ my $subdirs = $self->makemaker_args->{DIR} ||= [];
+ for my $subdir (@_) {
+ push @$subdirs, $subdir;
+ }
+}
+
+sub clean_files {
+ my $self = shift;
+ my $clean = $self->makemaker_args->{clean} ||= {};
+ %$clean = (
+ %$clean,
+ FILES => join(' ', grep length, $clean->{FILES}, @_),
+ );
+}
+
+sub realclean_files {
+ my $self = shift;
+ my $realclean = $self->makemaker_args->{realclean} ||= {};
+ %$realclean = (
+ %$realclean,
+ FILES => join(' ', grep length, $realclean->{FILES}, @_),
+ );
+}
+
+sub libs {
+ my $self = shift;
+ my $libs = ref $_[0] ? shift : [ shift ];
+ $self->makemaker_args( LIBS => $libs );
+}
+
+sub inc {
+ my $self = shift;
+ $self->makemaker_args( INC => shift );
+}
+
+sub write {
+ my $self = shift;
+ die "&Makefile->write() takes no arguments\n" if @_;
+
+ my $args = $self->makemaker_args;
+ $args->{DISTNAME} = $self->name;
+ $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args);
+ $args->{VERSION} = $self->version || $self->determine_VERSION($args);
+ $args->{NAME} =~ s/-/::/g;
+ if ( $self->tests ) {
+ $args->{test} = { TESTS => $self->tests };
+ }
+ if ($] >= 5.005) {
+ $args->{ABSTRACT} = $self->abstract;
+ $args->{AUTHOR} = $self->author;
+ }
+ if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
+ $args->{NO_META} = 1;
+ }
+ if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+ $args->{SIGN} = 1;
+ }
+ unless ( $self->is_admin ) {
+ delete $args->{SIGN};
+ }
+
+ # merge both kinds of requires into prereq_pm
+ my $prereq = ($args->{PREREQ_PM} ||= {});
+ %$prereq = ( %$prereq, map { @$_ } map { @$_ } grep $_,
+ ($self->build_requires, $self->requires) );
+
+ # merge both kinds of requires into prereq_pm
+ my $subdirs = ($args->{DIR} ||= []);
+ if ($self->bundles) {
+ foreach my $bundle (@{ $self->bundles }) {
+ my ($file, $dir) = @$bundle;
+ push @$subdirs, $dir if -d $dir;
+ delete $prereq->{$file};
+ }
+ }
+
+ if ( my $perl_version = $self->perl_version ) {
+ eval "use $perl_version; 1"
+ or die "ERROR: perl: Version $] is installed, "
+ . "but we need version >= $perl_version";
+ }
+
+ my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
+ if ($self->admin->preop) {
+ $args{dist} = $self->admin->preop;
+ }
+
+ my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
+ $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
+}
+
+sub fix_up_makefile {
+ my $self = shift;
+ my $makefile_name = shift;
+ my $top_class = ref($self->_top) || '';
+ my $top_version = $self->_top->VERSION || '';
+
+ my $preamble = $self->preamble
+ ? "# Preamble by $top_class $top_version\n"
+ . $self->preamble
+ : '';
+ my $postamble = "# Postamble by $top_class $top_version\n"
+ . ($self->postamble || '');
+
+ local *MAKEFILE;
+ open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ my $makefile = do { local $/; <MAKEFILE> };
+ close MAKEFILE or die $!;
+
+ $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
+ $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
+ $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
+ $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
+ $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
+
+ # Module::Install will never be used to build the Core Perl
+ # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
+ # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
+ $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
+ #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
+
+ # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
+ $makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g;
+
+ # XXX - This is currently unused; not sure if it breaks other MM-users
+ # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
+
+ open MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ print MAKEFILE "$preamble$makefile$postamble" or die $!;
+ close MAKEFILE or die $!;
+
+ 1;
+}
+
+sub preamble {
+ my ($self, $text) = @_;
+ $self->{preamble} = $text . $self->{preamble} if defined $text;
+ $self->{preamble};
+}
+
+sub postamble {
+ my ($self, $text) = @_;
+ $self->{postamble} ||= $self->admin->postamble;
+ $self->{postamble} .= $text if defined $text;
+ $self->{postamble}
+}
+
+1;
+
+__END__
+
+#line 334
Added: IPC-PubSub/inc/Module/Install/Metadata.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/inc/Module/Install/Metadata.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,315 @@
+#line 1
+package Module::Install::Metadata;
+
+use strict 'vars';
+use Module::Install::Base;
+
+use vars qw{$VERSION $ISCORE @ISA};
+BEGIN {
+ $VERSION = '0.64';
+ $ISCORE = 1;
+ @ISA = qw{Module::Install::Base};
+}
+
+my @scalar_keys = qw{
+ name module_name abstract author version license
+ distribution_type perl_version tests
+};
+
+my @tuple_keys = qw{
+ build_requires requires recommends bundles
+};
+
+sub Meta { shift }
+sub Meta_ScalarKeys { @scalar_keys }
+sub Meta_TupleKeys { @tuple_keys }
+
+foreach my $key (@scalar_keys) {
+ *$key = sub {
+ my $self = shift;
+ return $self->{values}{$key} if defined wantarray and !@_;
+ $self->{values}{$key} = shift;
+ return $self;
+ };
+}
+
+foreach my $key (@tuple_keys) {
+ *$key = sub {
+ my $self = shift;
+ return $self->{values}{$key} unless @_;
+
+ my @rv;
+ while (@_) {
+ my $module = shift or last;
+ my $version = shift || 0;
+ if ( $module eq 'perl' ) {
+ $version =~ s{^(\d+)\.(\d+)\.(\d+)}
+ {$1 + $2/1_000 + $3/1_000_000}e;
+ $self->perl_version($version);
+ next;
+ }
+ my $rv = [ $module, $version ];
+ push @rv, $rv;
+ }
+ push @{ $self->{values}{$key} }, @rv;
+ @rv;
+ };
+}
+
+sub sign {
+ my $self = shift;
+ return $self->{'values'}{'sign'} if defined wantarray and !@_;
+ $self->{'values'}{'sign'} = ( @_ ? $_[0] : 1 );
+ return $self;
+}
+
+sub dynamic_config {
+ my $self = shift;
+ unless ( @_ ) {
+ warn "You MUST provide an explicit true/false value to dynamic_config, skipping\n";
+ return $self;
+ }
+ $self->{'values'}{'dynamic_config'} = $_[0] ? 1 : 0;
+ return $self;
+}
+
+sub all_from {
+ my ( $self, $file ) = @_;
+
+ unless ( defined($file) ) {
+ my $name = $self->name
+ or die "all_from called with no args without setting name() first";
+ $file = join('/', 'lib', split(/-/, $name)) . '.pm';
+ $file =~ s{.*/}{} unless -e $file;
+ die "all_from: cannot find $file from $name" unless -e $file;
+ }
+
+ $self->version_from($file) unless $self->version;
+ $self->perl_version_from($file) unless $self->perl_version;
+
+ # The remaining probes read from POD sections; if the file
+ # has an accompanying .pod, use that instead
+ my $pod = $file;
+ if ( $pod =~ s/\.pm$/.pod/i and -e $pod ) {
+ $file = $pod;
+ }
+
+ $self->author_from($file) unless $self->author;
+ $self->license_from($file) unless $self->license;
+ $self->abstract_from($file) unless $self->abstract;
+}
+
+sub provides {
+ my $self = shift;
+ my $provides = ( $self->{values}{provides} ||= {} );
+ %$provides = (%$provides, @_) if @_;
+ return $provides;
+}
+
+sub auto_provides {
+ my $self = shift;
+ return $self unless $self->is_admin;
+
+ unless (-e 'MANIFEST') {
+ warn "Cannot deduce auto_provides without a MANIFEST, skipping\n";
+ return $self;
+ }
+
+ # Avoid spurious warnings as we are not checking manifest here.
+
+ local $SIG{__WARN__} = sub {1};
+ require ExtUtils::Manifest;
+ local *ExtUtils::Manifest::manicheck = sub { return };
+
+ require Module::Build;
+ my $build = Module::Build->new(
+ dist_name => $self->name,
+ dist_version => $self->version,
+ license => $self->license,
+ );
+ $self->provides(%{ $build->find_dist_packages || {} });
+}
+
+sub feature {
+ my $self = shift;
+ my $name = shift;
+ my $features = ( $self->{values}{features} ||= [] );
+
+ my $mods;
+
+ if ( @_ == 1 and ref( $_[0] ) ) {
+ # The user used ->feature like ->features by passing in the second
+ # argument as a reference. Accomodate for that.
+ $mods = $_[0];
+ } else {
+ $mods = \@_;
+ }
+
+ my $count = 0;
+ push @$features, (
+ $name => [
+ map {
+ ref($_) ? ( ref($_) eq 'HASH' ) ? %$_
+ : @$_
+ : $_
+ } @$mods
+ ]
+ );
+
+ return @$features;
+}
+
+sub features {
+ my $self = shift;
+ while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
+ $self->feature( $name, @$mods );
+ }
+ return $self->{values}->{features}
+ ? @{ $self->{values}->{features} }
+ : ();
+}
+
+sub no_index {
+ my $self = shift;
+ my $type = shift;
+ push @{ $self->{values}{no_index}{$type} }, @_ if $type;
+ return $self->{values}{no_index};
+}
+
+sub read {
+ my $self = shift;
+ $self->include_deps( 'YAML', 0 );
+
+ require YAML;
+ my $data = YAML::LoadFile('META.yml');
+
+ # Call methods explicitly in case user has already set some values.
+ while ( my ( $key, $value ) = each %$data ) {
+ next unless $self->can($key);
+ if ( ref $value eq 'HASH' ) {
+ while ( my ( $module, $version ) = each %$value ) {
+ $self->can($key)->($self, $module => $version );
+ }
+ }
+ else {
+ $self->can($key)->($self, $value);
+ }
+ }
+ return $self;
+}
+
+sub write {
+ my $self = shift;
+ return $self unless $self->is_admin;
+ $self->admin->write_meta;
+ return $self;
+}
+
+sub version_from {
+ my ( $self, $file ) = @_;
+ require ExtUtils::MM_Unix;
+ $self->version( ExtUtils::MM_Unix->parse_version($file) );
+}
+
+sub abstract_from {
+ my ( $self, $file ) = @_;
+ require ExtUtils::MM_Unix;
+ $self->abstract(
+ bless(
+ { DISTNAME => $self->name },
+ 'ExtUtils::MM_Unix'
+ )->parse_abstract($file)
+ );
+}
+
+sub _slurp {
+ my ( $self, $file ) = @_;
+
+ local *FH;
+ open FH, "< $file" or die "Cannot open $file.pod: $!";
+ do { local $/; <FH> };
+}
+
+sub perl_version_from {
+ my ( $self, $file ) = @_;
+
+ if (
+ $self->_slurp($file) =~ m/
+ ^
+ use \s*
+ v?
+ ([\d_\.]+)
+ \s* ;
+ /ixms
+ )
+ {
+ my $v = $1;
+ $v =~ s{_}{}g;
+ $self->perl_version($1);
+ }
+ else {
+ warn "Cannot determine perl version info from $file\n";
+ return;
+ }
+}
+
+sub author_from {
+ my ( $self, $file ) = @_;
+ my $content = $self->_slurp($file);
+ if ($content =~ m/
+ =head \d \s+ (?:authors?)\b \s*
+ ([^\n]*)
+ |
+ =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s*
+ .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s*
+ ([^\n]*)
+ /ixms) {
+ my $author = $1 || $2;
+ $author =~ s{E<lt>}{<}g;
+ $author =~ s{E<gt>}{>}g;
+ $self->author($author);
+ }
+ else {
+ warn "Cannot determine author info from $file\n";
+ }
+}
+
+sub license_from {
+ my ( $self, $file ) = @_;
+
+ if (
+ $self->_slurp($file) =~ m/
+ =head \d \s+
+ (?:licen[cs]e|licensing|copyright|legal)\b
+ (.*?)
+ (=head\\d.*|=cut.*|)
+ \z
+ /ixms
+ )
+ {
+ my $license_text = $1;
+ my @phrases = (
+ 'under the same (?:terms|license) as perl itself' => 'perl',
+ 'GNU public license' => 'gpl',
+ 'GNU lesser public license' => 'gpl',
+ 'BSD license' => 'bsd',
+ 'Artistic license' => 'artistic',
+ 'GPL' => 'gpl',
+ 'LGPL' => 'lgpl',
+ 'BSD' => 'bsd',
+ 'Artistic' => 'artistic',
+ );
+ while ( my ( $pattern, $license ) = splice( @phrases, 0, 2 ) ) {
+ $pattern =~ s{\s+}{\\s+}g;
+ if ( $license_text =~ /\b$pattern\b/i ) {
+ $self->license($license);
+ return 1;
+ }
+ }
+ }
+
+ warn "Cannot determine license info from $file\n";
+ return 'unknown';
+}
+
+1;
Added: IPC-PubSub/inc/Module/Install/Win32.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/inc/Module/Install/Win32.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,65 @@
+#line 1
+package Module::Install::Win32;
+
+use strict;
+use Module::Install::Base;
+
+use vars qw{$VERSION $ISCORE @ISA};
+BEGIN {
+ $VERSION = '0.64';
+ $ISCORE = 1;
+ @ISA = qw{Module::Install::Base};
+}
+
+# determine if the user needs nmake, and download it if needed
+sub check_nmake {
+ my $self = shift;
+ $self->load('can_run');
+ $self->load('get_file');
+
+ require Config;
+ return unless (
+ $^O eq 'MSWin32' and
+ $Config::Config{make} and
+ $Config::Config{make} =~ /^nmake\b/i and
+ ! $self->can_run('nmake')
+ );
+
+ print "The required 'nmake' executable not found, fetching it...\n";
+
+ require File::Basename;
+ my $rv = $self->get_file(
+ url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe',
+ ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe',
+ local_dir => File::Basename::dirname($^X),
+ size => 51928,
+ run => 'Nmake15.exe /o > nul',
+ check_for => 'Nmake.exe',
+ remove => 1,
+ );
+
+ if (!$rv) {
+ die <<'END_MESSAGE';
+
+-------------------------------------------------------------------------------
+
+Since you are using Microsoft Windows, you will need the 'nmake' utility
+before installation. It's available at:
+
+ http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe
+ or
+ ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe
+
+Please download the file manually, save it to a directory in %PATH% (e.g.
+C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
+that directory, and run "Nmake15.exe" from there; that will create the
+'nmake.exe' file needed by this module.
+
+You may then resume the installation process described in README.
+
+-------------------------------------------------------------------------------
+END_MESSAGE
+ }
+}
+
+1;
Added: IPC-PubSub/inc/Module/Install/WriteAll.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/inc/Module/Install/WriteAll.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,43 @@
+#line 1
+package Module::Install::WriteAll;
+
+use strict;
+use Module::Install::Base;
+
+use vars qw{$VERSION $ISCORE @ISA};
+BEGIN {
+ $VERSION = '0.64';
+ $ISCORE = 1;
+ @ISA = qw{Module::Install::Base};
+}
+
+sub WriteAll {
+ my $self = shift;
+ my %args = (
+ meta => 1,
+ sign => 0,
+ inline => 0,
+ check_nmake => 1,
+ @_
+ );
+
+ $self->sign(1) if $args{sign};
+ $self->Meta->write if $args{meta};
+ $self->admin->WriteAll(%args) if $self->is_admin;
+
+ if ( $0 =~ /Build.PL$/i ) {
+ $self->Build->write;
+ } else {
+ $self->check_nmake if $args{check_nmake};
+ unless ( $self->makemaker_args->{'PL_FILES'} ) {
+ $self->makemaker_args( PL_FILES => {} );
+ }
+ if ($args{inline}) {
+ $self->Inline->write;
+ } else {
+ $self->Makefile->write;
+ }
+ }
+}
+
+1;
Added: IPC-PubSub/lib/IPC/PubSub.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/lib/IPC/PubSub.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,155 @@
+package IPC::PubSub;
+$IPC::PubSub::VERSION = '0.10';
+
+use 5.005;
+use strict;
+use IPC::PubSub::Publisher;
+use IPC::PubSub::Subscriber;
+use base qw/Class::Accessor::Fast/;
+
+__PACKAGE__->mk_accessors(qw/_cache/);
+
+sub new {
+ my $self = bless {}, shift;
+
+ my $backend = shift || 'PlainHash';
+
+ local $@;
+ eval { require "IPC/PubSub/Cache/$backend.pm" }
+ or die "Cannot load backend module: IPC::PubSub::Cache::$backend: $@";
+
+ $self->_cache("IPC::PubSub::Cache::$backend"->new(@_));
+ return $self;
+}
+
+sub new_publisher {
+ my $self = shift;
+ IPC::PubSub::Publisher->new($self->_cache, @_ ? @_ : '');
+}
+
+sub new_subscriber {
+ my $self = shift;
+ IPC::PubSub::Subscriber->new($self->_cache, @_ ? @_ : '');
+}
+
+sub fetch { (+shift)->fetch(@_) }
+sub store { (+shift)->store(@_) }
+sub lock { (+shift)->lock(@_) }
+sub unlock { (+shift)->unlock(@_) }
+
+1;
+
+__END__
+
+=head1 NAME
+
+IPC::PubSub - Interprocess Publish/Subscribe channels
+
+=head1 SYNOPSIS
+
+ # A new message bus with the DBM::Deep backend
+ # (Other possible backends include Memcached and PlainHash)
+ my $bus = IPC::PubSub->new(DBM_Deep => '/tmp/pubsub.db');
+
+ # A channel is any arbitrary string
+ my $channel = '#perl6';
+
+ # Register a new publisher (you can publish to multiple channels)
+ my $pub = $bus->new_publisher("#perl6", "#moose");
+
+ # Publish a message (may be a complex object) to those channels
+ $pub->msg("This is a message");
+
+ # Register a new subscriber (you can subscribe to multiple channels)
+ my $sub = $bus->new_subscriber("#moose");
+
+ # Publish an object to channels
+ $pub->msg("This is another message");
+
+ # Set all subsequent messages from this publisher to expire in 30 seconds
+ $pub->expiry(30);
+ $pub->msg("This message will go away in 30 seconds");
+
+ # Simple get: Returns the messages sent since the previous get,
+ # but only for the first channel.
+ my @msgs = $sub->get;
+
+ # Simple get, with an explicit channel key (must be among the ones
+ # it initially subscribed to)
+ my @moose_msgs = $sub->get("#moose");
+
+ # Complex get: Returns a hash reference from channels to array
+ # references of [timestamp, message].
+ my $hash_ref = $sub->get_all;
+
+ # Changing the list of channels we subscribe to
+ $sub->subscribe('some-other-channel');
+ $sub->unsubscribe('some-other-channel');
+
+ # Changing the list of channels we publish to
+ $pub->publish('some-other-channel');
+ $pub->unpublish('some-other-channel');
+
+ # Listing and checking if we are in a channel
+ my @sub_channels = $sub->channels;
+ my @pub_channels = $pub->channels;
+ print "Sub is in #moose" if $sub->channels->{'#moose'};
+ print "Pub is in #moose" if $pub->channels->{'#moose'};
+
+ # Raw APIs to manipulate the cache
+ $bus->lock('channel');
+ $bus->unlock('channel');
+ my @timed_msgs = $bus->fetch('key1', 'key2', 'key3');
+ $bus->store('key', 'value', time, 30);
+
+=head1 DESCRIPTION
+
+This module provides a simple API for publishing messages to I<channels>
+and for subscribing to them.
+
+When a I<message> is published on a channel, all subscribers currently in
+that channel will get it on their next C<get> or C<get_all> call.
+
+Currently, it offers three backends: C<DBM_Deep> for on-disk storage,
+C<Memcached> for possibly multi-host storage, and C<PlainHash> for
+single-process storage.
+
+Please see the tests in F<t/> for this distribution, as well as L</SYNOPSIS>
+above, for some usage examples; detailed documentation is not yet available.
+
+=head1 SEE ALSO
+
+L<IPC::DirQueue>, where the subscribers divide the published messages among
+themselves, so different subscribers never see the same message.
+
+=head1 AUTHORS
+
+Audrey Tang E<lt>cpan at audreyt.orgE<gt>
+
+=head1 COPYRIGHT
+
+Copyright 2006 by Audrey Tang E<lt>cpan at audreyt.orgE<gt>.
+
+This software is released under the MIT license cited below.
+
+=head2 The "MIT" License
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+=cut
Added: IPC-PubSub/lib/IPC/PubSub/Cache/DBM_Deep.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/lib/IPC/PubSub/Cache/DBM_Deep.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,60 @@
+package IPC::PubSub::Cache::DBM_Deep;
+use strict;
+use base 'IPC::PubSub::Cacheable';
+use DBM::Deep;
+use File::Temp qw/ tempfile /;
+
+sub new {
+ my $class = shift;
+ my $file = shift;
+ my $mem = DBM::Deep->new($file || $class->default_config);
+ bless(\$mem, $class);
+}
+
+sub default_config {
+ my (undef, $filename) = tempfile(UNLINK => 1);
+ return $filename;
+}
+
+sub fetch {
+ my $self = shift;
+ map { $$self->get($_) } @_;
+}
+
+sub store {
+ my ($self, $key, $val, $time, $expiry) = @_;
+ $$self->put($key, [$time, $val]);
+}
+
+sub publisher_indices {
+ my ($self, $chan) = @_;
+ return { %{ $$self->get("$chan#") || {} } };
+}
+
+sub add_publisher {
+ my ($self, $chan, $pub) = @_;
+ my $pubs = { %{ $$self->get("$chan#") || {} } };
+ $pubs->{$pub} = 0;
+ $$self->put("$chan#", $pubs);
+}
+
+sub remove_publisher {
+ my ($self, $chan, $pub) = @_;
+ my $pubs = { %{ $$self->get("$chan#") || {} } };
+ delete $pubs->{$pub};
+ $$self->put("$chan#", $pubs);
+}
+
+sub get_index {
+ my ($self, $chan, $pub) = @_;
+ ($$self->get("$chan#") || {})->{$pub};
+}
+
+sub set_index {
+ my ($self, $chan, $pub, $idx) = @_;
+ my $pubs = { %{ $$self->get("$chan#") || {} } };
+ $pubs->{$pub} = $idx;
+ $$self->put("$chan#", $pubs);
+}
+
+1;
Added: IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,90 @@
+package IPC::PubSub::Cache::JiftyDBI;
+use strict;
+use base 'IPC::PubSub::Cacheable';
+use IPC::PubSub::Cache::JiftyDBI::Stash;
+my %cache;
+
+use vars qw/$STASH/;
+
+sub new {
+ my $class = shift;
+ my $self = {};
+ bless $self => $class;
+ $STASH ||= IPC::PubSub::Cache::JiftyDBI::Stash->new(@_);
+
+ return $self;
+}
+
+
+
+sub fetch {
+ my $self = shift;
+ my @keys_in_order = (@_);
+ my $items = IPC::PubSub::Cache::JiftyDBI::Stash::ItemCollection->new( handle => $STASH->handle );
+ foreach my $val (@keys_in_order) {
+ $items->limit(
+ column => 'key',
+ entry_aggregator => 'or',
+ value => $val
+ );
+ }
+
+ my %items = map { $_->key, [$_->expiry, $_->val] } @{ $items->items_array_ref };
+ return @items{@keys_in_order};
+}
+
+sub store {
+ my ($self, $key, $val, $time, $expiry) = @_;
+ $expiry ||= 0;
+ my $item = IPC::PubSub::Cache::JiftyDBI::Stash::Item->new(handle => $STASH->handle);
+ $item->create( key => $key, expiry => ($time+$expiry), val => $val);
+}
+
+sub publisher_indices {
+ my ($self, $chan) = @_;
+ my $publishers = IPC::PubSub::Cache::JiftyDBI::Stash::PublisherCollection->new(handle => $STASH->handle);
+ $publishers->limit(column => 'channel', value => $chan);
+
+ my %indices;
+ map {$indices{$_->name} = $_->idx} @{$publishers->items_array_ref};
+ return \%indices;
+
+}
+
+sub add_publisher {
+ my ($self, $chan, $pub) = @_;
+
+ my $publisher = IPC::PubSub::Cache::JiftyDBI::Stash::Publisher->new(handle => $STASH->handle);
+ $publisher->create( channel => $chan, name => $pub, idx => 0);
+
+}
+
+sub remove_publisher {
+ my ($self, $chan, $pub) = @_;
+ my $publisher = _get_publisher($chan => $pub);
+ $publisher->delete();
+
+}
+
+sub get_index {
+ my ($self, $chan, $pub) = @_;
+ my $publisher = _get_publisher($chan => $pub);
+ if ($publisher->id) {
+ return $publisher->idx
+ }
+
+}
+
+sub set_index {
+ my ($self, $chan, $pub, $idx) = @_;
+ return _get_publisher($chan => $pub)->set_idx($idx);
+}
+
+sub _get_publisher {
+ my $chan = shift;
+ my $pub = shift;
+ my $publisher = IPC::PubSub::Cache::JiftyDBI::Stash::Publisher->new(handle => $STASH->handle);
+ $publisher->load_by_cols( channel => $chan, name => $pub);
+ return $publisher;
+}
+1;
Added: IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI/Stash.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI/Stash.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,68 @@
+package IPC::PubSub::Cache::JiftyDBI::Stash;
+use warnings;
+use strict;
+
+
+use Jifty::DBI::Handle;
+use Jifty::DBI::SchemaGenerator;
+ use File::Temp qw/ tempfile tempdir /;
+use IPC::PubSub::Cache::JiftyDBI::Stash::Item;
+use IPC::PubSub::Cache::JiftyDBI::Stash::Publisher;
+my $FILE= $ENV{'HOME'}. '/.messagebus.sqlite';
+
+sub new {
+ my $class = shift;
+ my $self = {};
+ bless $self, $class;
+
+ my %args = (
+ db_init => 0,
+ db_config => undef,
+ @_
+ );
+ unless ( $args{'db_config'} ) {
+ my $filename;
+ ( undef, $filename ) = tempfile();
+
+ $args{'db_config'} = { driver => 'SQLite', database => $filename };
+ }
+
+ $self->_connect( %{$args{'db_config'}} );
+ if ( $args{'db_init'} ) {
+ $self->_generate_db();
+ }
+ $self;
+}
+
+sub handle {
+ my $self = shift;
+ $self->{'handle'} = shift if (@_);
+ return $self->{'handle'};
+}
+
+sub _generate_db {
+ my $self = shift;
+ my $gen = Jifty::DBI::SchemaGenerator->new( $self->handle );
+ $gen->add_model( IPC::PubSub::Cache::JiftyDBI::Stash::Item->new( handle => $self->handle ) );
+ $gen->add_model( IPC::PubSub::Cache::JiftyDBI::Stash::Publisher->new( handle => $self->handle ) );
+ my @statements = $gen->create_table_sql_statements;
+ $self->handle->begin_transaction;
+ for my $statement (@statements) {
+ my $ret = $self->handle->simple_query($statement);
+ }
+ $self->handle->commit;
+
+}
+
+
+sub _connect {
+ my $self = shift;
+
+
+ my $handle = Jifty::DBI::Handle->new();
+ $handle->connect(@_);
+ $self->handle($handle);
+}
+
+
+1;
Added: IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI/Stash/Item.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI/Stash/Item.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,23 @@
+package IPC::PubSub::Cache::JiftyDBI::Stash::Item;
+
+use warnings;
+use strict;
+
+use Jifty::DBI::Schema;
+use Jifty::DBI::Record schema {
+ column key => type is 'text';
+ column val => type is 'blob', filters are 'Jifty::DBI::Filter::Storable';
+ column expiry => type is 'int';
+};
+
+package IPC::PubSub::Cache::JiftyDBI::Stash::ItemCollection;
+use base qw/Jifty::DBI::Collection/;
+
+sub table {
+ my $self = shift;
+ my $tab = $self->new_item->table();
+ return $tab;
+}
+
+
+1;
Added: IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI/Stash/Publisher.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/lib/IPC/PubSub/Cache/JiftyDBI/Stash/Publisher.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,23 @@
+package IPC::PubSub::Cache::JiftyDBI::Stash::Publisher;
+
+use warnings;
+use strict;
+
+use Jifty::DBI::Schema;
+use Jifty::DBI::Record schema {
+ column channel => type is 'text';
+ column name => type is 'text';
+ column idx => type is 'int';
+};
+
+
+package IPC::PubSub::Cache::JiftyDBI::Stash::PublisherCollection;
+use base qw/Jifty::DBI::Collection/;
+
+sub table {
+ my $self = shift;
+ my $tab = $self->new_item->table();
+ return $tab;
+}
+
+1;
Added: IPC-PubSub/lib/IPC/PubSub/Cache/Memcached.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/lib/IPC/PubSub/Cache/Memcached.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,78 @@
+package IPC::PubSub::Cache::Memcached;
+use strict;
+use base 'IPC::PubSub::Cacheable';
+use Cache::Memcached;
+
+sub new {
+ my $class = shift;
+ my $config = shift || $class->default_config;
+ my $mem = Cache::Memcached->new($config);
+ bless(\$mem, $class);
+}
+
+sub default_config {
+ return {
+ servers => ['127.0.0.1:11211'],
+ debug => 0
+ };
+}
+
+sub fetch {
+ my $self = shift;
+ values(%{$$self->get_multi(@_)});
+}
+
+sub store {
+ my ($self, $key, $val, $time, $expiry) = @_;
+ $$self->set($key, [$time, $val], $expiry);
+}
+
+sub publisher_indices {
+ my ($self, $chan) = @_;
+ $$self->get("$chan#") || {};
+}
+
+sub lock {
+ my ($self, $chan) = @_;
+ for my $i (1..10) {
+ return if $$self->add("$chan#lock" => 1);
+ sleep 1;
+ }
+}
+
+sub unlock {
+ my ($self, $chan) = @_;
+ $$self->delete("$chan#lock");
+}
+
+sub add_publisher {
+ my ($self, $chan, $pub) = @_;
+ $self->lock($chan);
+ my $pubs = $$self->get("$chan#") || {};
+ $pubs->{$pub} = 0;
+ $$self->set("$chan#", $pubs);
+ $self->unlock($chan);
+}
+
+sub remove_publisher {
+ my ($self, $chan, $pub) = @_;
+ $self->lock($chan);
+ my $pubs = $$self->get("$chan#") || {};
+ delete $pubs->{$pub};
+ $$self->set("$chan#", $pubs);
+ $self->unlock($chan);
+}
+
+sub get_index {
+ my ($self, $chan, $pub) = @_;
+ ($$self->get("$chan#") || {})->{$pub};
+}
+
+sub set_index {
+ my ($self, $chan, $pub, $idx) = @_;
+ my $pubs = $$self->get("$chan#") || {};
+ $pubs->{$pub} = $idx;
+ $$self->set("$chan#", $pubs);
+}
+
+1;
Added: IPC-PubSub/lib/IPC/PubSub/Cache/PlainHash.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/lib/IPC/PubSub/Cache/PlainHash.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,44 @@
+package IPC::PubSub::Cache::PlainHash;
+use strict;
+use base 'IPC::PubSub::Cacheable';
+
+my %cache;
+
+use constant new => __PACKAGE__;
+
+sub fetch {
+ my $self = shift;
+ @cache{@_};
+}
+
+sub store {
+ my ($self, $key, $val, $time, $expiry) = @_;
+ $cache{$key} = [$time => $val];
+}
+
+sub publisher_indices {
+ my ( $self, $chan ) = @_;
+ +{ %{ $cache{$chan} || {} } };
+}
+
+sub add_publisher {
+ my ($self, $chan, $pub) = @_;
+ $cache{$chan}{$pub} = 0;
+}
+
+sub remove_publisher {
+ my ($self, $chan, $pub) = @_;
+ delete $cache{$chan}{$pub};
+}
+
+sub get_index {
+ my ($self, $chan, $pub) = @_;
+ $cache{$chan}{$pub};
+}
+
+sub set_index {
+ my ($self, $chan, $pub, $idx) = @_;
+ $cache{$chan}{$pub} = $idx;
+}
+
+1;
Added: IPC-PubSub/lib/IPC/PubSub/Cacheable.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/lib/IPC/PubSub/Cacheable.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,60 @@
+package IPC::PubSub::Cacheable;
+use strict;
+use Time::HiRes 'time';
+use File::Spec;
+
+#method fetch (Str *@keys --> List of Pair) { ... }
+#method store (Str $key, Str $val, Num $time, Num $expiry) { ... }
+
+#method add_publisher (Str $chan, Str $pub) { ... }
+#method remove_publisher (Str $chan, Str $pub) { ... }
+
+#method get_index (Str $chan, Str $pub --> Int) { ... }
+#method set_index (Str $chan, Str $pub, Int $index) { ... }
+
+#method publisher_indices (Str $chan --> Hash of Int) { ... }
+
+sub get {
+ my ($self, $chan, $orig, $curr) = @_;
+
+ no warnings 'uninitialized';
+ sort { $a->[0] <=> $b->[0] } $self->fetch(
+ map {
+ my $pub = $_;
+ my $index = $curr->{$pub};
+ map {
+ "$chan-$pub-$_"
+ } (($orig->{$pub}+1) .. $index);
+ } keys(%$curr)
+ );
+}
+
+sub put {
+ my ($self, $chan, $pub, $index, $msg, $expiry) = @_;
+ $self->store("$chan-$pub-$index", $msg, time, $expiry);
+ $self->set_index($chan, $pub, $index);
+}
+
+
+use constant LOCK => File::Spec->catdir(File::Spec->tmpdir, 'IPC::PubSub-lock-');
+
+my %locks;
+sub lock {
+ my ($self, $chan) = @_;
+ for my $i (1..10) {
+ return if mkdir((LOCK . unpack("H*", $chan)), 0777);
+ sleep 1;
+ }
+}
+
+END {
+ rmdir(LOCK . unpack("H*", $_)) for keys %locks;
+}
+
+sub unlock {
+ my ($self, $chan) = @_;
+ rmdir(LOCK . unpack("H*", $chan));
+ delete $locks{$chan};
+}
+
+1;
Added: IPC-PubSub/lib/IPC/PubSub/Publisher.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/lib/IPC/PubSub/Publisher.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,61 @@
+package IPC::PubSub::Publisher;
+use strict;
+use Data::UUID;
+use base qw/Class::Accessor::Fast/;
+
+__PACKAGE__->mk_accessors(qw/expiry _indice _uuid _cache/);
+
+sub new {
+ my $class = shift;
+ my $cache = shift;
+ my $uuid = Data::UUID->new->create_b64;
+ my $self = bless({
+ expiry => 0,
+ _cache => $cache,
+ _indice => { map { $_ => 1 } @_ },
+ _uuid => $uuid,
+ });
+ $cache->add_publisher($_, $uuid) for @_;
+ return $self;
+}
+
+sub channels {
+ my $self = shift;
+ wantarray
+ ? keys(%{$self->_indice})
+ : $self->_indice;
+}
+
+sub publish {
+ my $self = shift;
+ $self->_indice->{$_} ||= do {
+ $self->_cache->add_publisher($_);
+ 1;
+ } for @_;
+}
+
+sub unpublish {
+ my $self = shift;
+ delete($self->_indice->{$_}) and $self->_cache->remove_publisher($_) for @_;
+}
+
+sub msg {
+ my $self = shift;
+ my $uuid = $self->_uuid;
+ my $indice = $self->_indice;
+ my $expiry = $self->expiry;
+ foreach my $msg (@_) {
+ while (my ($channel, $index) = each %$indice) {
+ $self->_cache->put($channel, $uuid, $index, $msg, $expiry);
+ $indice->{$channel} = $index+1;
+ }
+ }
+}
+
+no warnings 'redefine';
+sub DESTROY {
+ my $self = shift;
+ $self->_cache->remove_publisher($_, $self->_cache) for $self->channels;
+}
+
+1;
Added: IPC-PubSub/lib/IPC/PubSub/Subscriber.pm
==============================================================================
--- (empty file)
+++ IPC-PubSub/lib/IPC/PubSub/Subscriber.pm Wed Oct 25 12:21:07 2006
@@ -0,0 +1,58 @@
+package IPC::PubSub::Subscriber;
+
+use strict;
+use base qw/Class::Accessor::Fast/;
+
+__PACKAGE__->mk_accessors(qw/_pubs _cache/);
+
+sub new {
+ my $class = shift;
+ my $cache = shift;
+ my $pubs = { map { $_ => $cache->publisher_indices($_); } @_ };
+ bless({ _cache => $cache, _pubs => $pubs });
+}
+
+sub channels {
+ my $self = shift;
+ wantarray
+ ? keys(%{$self->_pubs})
+ : $self->_pubs;
+}
+
+sub subscribe {
+ my $self = shift;
+ $self->_pubs->{$_} ||= $self->_cache->publisher_indices($_) for @_;
+}
+
+sub unsubscribe {
+ my $self = shift;
+ delete @{$self->_pubs}{@_};
+}
+
+sub get_all {
+ my $self = shift;
+ my $pubs = $self->_pubs;
+ my $cache = $self->_cache;
+ return {
+ map {
+ my $orig = $pubs->{$_};
+ $pubs->{$_} = $cache->publisher_indices($_);
+ $_ => [ grep { defined } $cache->get($_, $orig, $pubs->{$_})];
+ } $self->channels
+ };
+}
+
+sub get {
+ my $self = shift;
+ my $pubs = $self->_pubs;
+ my $cache = $self->_cache;
+ my ($chan) = @_ ? @_ : sort($self->channels) or return;
+
+ my $orig = $pubs->{$chan};
+ $pubs->{$chan} = $cache->publisher_indices($chan);
+ wantarray
+ ? map {$_ ? $_->[1] : ()} $cache->get($chan, $orig, $pubs->{$chan})
+ : [map {$_ ? $_->[1] : ()} $cache->get($chan, $orig, $pubs->{$chan})];
+}
+
+1;
Added: IPC-PubSub/t/basic.t
==============================================================================
--- (empty file)
+++ IPC-PubSub/t/basic.t Wed Oct 25 12:21:07 2006
@@ -0,0 +1,43 @@
+use strict;
+use warnings;
+use Test::More;
+use IPC::PubSub;
+use IO::Socket::INET;
+
+my @backends = qw(PlainHash);
+
+unshift @backends, 'DBM_Deep' if eval { require DBM::Deep };
+unshift @backends, 'JiftyDBI' if eval { require Jifty::DBI };
+unshift @backends, 'Memcached' if eval { require Cache::Memcached } and IO::Socket::INET->new('127.0.0.1:11211');
+
+plan tests => 6 * scalar @backends;
+
+SKIP: for my $backend (@backends) {
+ my %init_args = ();
+ diag('Testing backend '.$backend);
+ if ($backend eq 'JiftyDBI') {
+ $init_args{db_init} = 1;
+ }
+
+ my $bus = IPC::PubSub->new($backend, %init_args);
+
+ my @sub; $sub[0] = $bus->new_subscriber;
+
+ is_deeply([map {$_->[1]} @{$sub[0]->get_all->{''}}], [], 'get_all worked when there is no pubs');
+ is_deeply([$sub[0]->get], [], 'get_all worked when there is no pubs');
+
+ my $pub = $bus->new_publisher;
+
+ $pub->msg('foo');
+
+ $sub[1] = $bus->new_subscriber;
+
+ $pub->msg(['bar', 'bar']);
+ $pub->msg('baz');
+
+ is_deeply([$sub[0]->get], ['foo', ['bar', 'bar'], 'baz'], 'get worked');
+ is_deeply([$sub[0]->get], [], 'get emptied the cache');
+
+ is_deeply([map {$_->[1]} @{$sub[1]->get_all->{''}}], [['bar', 'bar'], 'baz'], 'get_all worked');
+ is_deeply([map {$_->[1]} @{$sub[1]->get_all->{''}}], [], 'get_all emptied the cache');
+}
More information about the Rt-commit
mailing list