Permalink
Browse files

* Added a RELEASING recipe file.

 * Added the MANIFEST to source control.
 * Require minimum versions of POE (0.38) and PoCo::Generic (0.1001) for memory leak purposes.
 * Updated versions for upcoming release.
 * ::Storage::Throttled -- send throttle messages before calling the user message_stored handler.
  • Loading branch information...
dsnopek committed Jun 7, 2007
1 parent f3078eb commit 01af9aa50c8c24aaae70a00cc94eca5780f7cb6d
View
@@ -0,0 +1,51 @@
+bin/mq.pl
+examples/mq_complex.pl
+examples/mq_dbi.pl
+examples/mq_easydbi.pl
+examples/mq_filesystem.pl
+examples/mq_generic_dbi.pl
+examples/mq_memory.pl
+examples/stomp_server.pl
+examples/test_recv.pl
+examples/test_send.pl
+inc/Module/AutoInstall.pm
+inc/Module/Install.pm
+inc/Module/Install/AutoInstall.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Include.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/Scripts.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+lib/POE/Component/MessageQueue.pm
+lib/POE/Component/MessageQueue/Client.pm
+lib/POE/Component/MessageQueue/Logger.pm
+lib/POE/Component/MessageQueue/Message.pm
+lib/POE/Component/MessageQueue/Queue.pm
+lib/POE/Component/MessageQueue/Storage.pm
+lib/POE/Component/MessageQueue/Storage/Complex.pm
+lib/POE/Component/MessageQueue/Storage/DBI.pm
+lib/POE/Component/MessageQueue/Storage/EasyDBI.pm
+lib/POE/Component/MessageQueue/Storage/FileSystem.pm
+lib/POE/Component/MessageQueue/Storage/Generic.pm
+lib/POE/Component/MessageQueue/Storage/Generic/DBI.pm
+lib/POE/Component/MessageQueue/Storage/Memory.pm
+lib/POE/Component/MessageQueue/Storage/Throttled.pm
+lib/POE/Component/MessageQueue/Subscription.pm
+lib/POE/Component/Server/Stomp.pm
+log.conf
+Makefile
+Makefile.PL
+MANIFEST This list of files
+MANIFEST.SKIP
+META.yml
+README
+RELEASING
+schema/mysql.sql
+schema/sqlite.sql
+test.sh
+test/Storage/DBI.pm
+test/Storage/Generic/DBI.pm
View
@@ -4,7 +4,7 @@ use inc::Module::Install;
name 'POE-Component-MessageQueue';
abstract 'A Perl message queue based on POE that uses STOMP as its communication protocol.';
author 'David Snopek';
-version '0.1.1';
+version '0.1.3';
license 'gpl';
build_requires 'Data::Dumper';
@@ -14,13 +14,14 @@ build_requires 'File::Temp';
requires 'POE' => 0.38;
requires 'POE::Component::Server::TCP';
requires 'POE::Component::Logger';
+requires 'POE::Component::Generic' => 0.1001;
requires 'POE::Wheel::ReadWrite';
-requires 'IO::String';
-requires 'IO::File';
requires 'Net::Stomp';
-requires 'Carp';
requires 'DBI';
requires 'DBD::SQLite' => 1.13;
+requires 'IO::String';
+requires 'IO::File';
+requires 'Carp';
no_index directory => 'test';
no_index directory => 'examples';
View
@@ -0,0 +1,15 @@
+
+TODO for making a release.
+
+ * Change the $VERSION variable in lib/POE/Component/MessageQueue.pm
+
+ * Change the version argument in Makefile.PL
+
+ * Run 'perl Makefile.PL'
+
+ * Run 'make manifest'
+
+ * Look over MANIFEST and delete unused files in source tree (or just
+ their entries in MANIFEST).
+
+
@@ -1,14 +1,17 @@
package POE::Component::MessageQueue;
-use POE;
+use POE 0.38;
use POE::Component::Server::Stomp;
use POE::Component::MessageQueue::Client;
use POE::Component::MessageQueue::Queue;
use POE::Component::MessageQueue::Message;
use Net::Stomp;
+use vars qw($VERSION);
use strict;
+$VERSION = '0.1.3';
+
use Carp qw(croak);
use Data::Dumper;
@@ -3,7 +3,7 @@ package POE::Component::MessageQueue::Storage::Generic;
use base qw(POE::Component::MessageQueue::Storage);
use POE;
-use POE::Component::Generic;
+use POE::Component::Generic 0.1001;
use POE::Component::MessageQueue::Logger;
use strict;
@@ -112,11 +112,8 @@ sub _message_stored
{
my ($self, $destination) = @_;
- if ( defined $self->{message_stored} )
- {
- $self->{message_stored}->( $destination );
- }
-
+ # first, check if there are any throttled messages we can now push to
+ # the underlying storage engine.
if ( $self->{throttle_max} )
{
my $message = $self->_throttle_pop();
@@ -132,6 +129,12 @@ sub _message_stored
$self->{throttle_count} --;
}
}
+
+ # Then, call the user handler!
+ if ( defined $self->{message_stored} )
+ {
+ $self->{message_stored}->( $destination );
+ }
}
sub get_next_message_id
View
@@ -6,7 +6,7 @@ dispatchers = file screen
file.class = Log::Dispatch::File
#file.min_level = debug
file.min_level = warning
-file.filename = /var/log/perl_mq.log
+file.filename = /tmp/perl_mq.log
file.mode = append
file.format = [%d] [%p] %m

0 comments on commit 01af9aa

Please sign in to comment.