[libmessage-passing-zeromq-perl] 67/78: enable spooling messages to disk in output
Jonas Smedegaard
js at alioth.debian.org
Mon Sep 30 09:28:29 UTC 2013
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libmessage-passing-zeromq-perl.
commit 670eea9d6f6479d24d4236f570f8919a32d5f6c9
Author: Lex Neva <lex.neva at timgroup.com>
Date: Fri Aug 9 15:20:12 2013 -0400
enable spooling messages to disk in output
---
lib/Message/Passing/Input/ZeroMQ.pm | 1 +
lib/Message/Passing/Output/ZeroMQ.pm | 1 +
lib/Message/Passing/ZeroMQ/Role/HasASocket.pm | 14 ++++++++++++++
3 files changed, 16 insertions(+)
diff --git a/lib/Message/Passing/Input/ZeroMQ.pm b/lib/Message/Passing/Input/ZeroMQ.pm
index 90891de..999641c 100644
--- a/lib/Message/Passing/Input/ZeroMQ.pm
+++ b/lib/Message/Passing/Input/ZeroMQ.pm
@@ -20,6 +20,7 @@ has '+_socket' => (
sub _socket_type { 'SUB' }
sub _build_socket_hwm { 100000 }
+sub _build_socket_swap { 0 }
has subscribe => (
isa => sub { ref($_[0]) eq 'ARRAY' },
diff --git a/lib/Message/Passing/Output/ZeroMQ.pm b/lib/Message/Passing/Output/ZeroMQ.pm
index 84dab39..4b90cd6 100644
--- a/lib/Message/Passing/Output/ZeroMQ.pm
+++ b/lib/Message/Passing/Output/ZeroMQ.pm
@@ -17,6 +17,7 @@ has '+_socket' => (
sub _socket_type { 'PUB' }
sub _build_socket_hwm { 10000 }
+sub _build_socket_swap { 1024*1024*100 }
sub consume {
my $self = shift;
diff --git a/lib/Message/Passing/ZeroMQ/Role/HasASocket.pm b/lib/Message/Passing/ZeroMQ/Role/HasASocket.pm
index 16ca87f..dcdc4ae 100644
--- a/lib/Message/Passing/ZeroMQ/Role/HasASocket.pm
+++ b/lib/Message/Passing/ZeroMQ/Role/HasASocket.pm
@@ -70,9 +70,23 @@ has socket_hwm => (
lazy => 1,
);
+has socket_swap => (
+ is => 'ro',
+ isa => Int,
+ builder => '_build_socket_swap',
+ lazy => 1,
+);
+
sub setsockopt {
my ($self, $socket) = @_;
$socket->setsockopt(ZMQ_HWM, $self->socket_hwm);
+
+ # work around ZeroMQ issue 140: ZMQ_SWAP expects to
+ # be able to write to the current directory and
+ # crashes if it can't
+ chdir("/tmp");
+
+ $socket->setsockopt(ZMQ_SWAP, $self->socket_swap);
}
has socket_bind => (
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmessage-passing-zeromq-perl.git
More information about the Pkg-perl-cvs-commits
mailing list