<NME> zmq.rb
<BEF> ADDFILE
<MSG> Merge pull request #79 from masterzen/feature/zeromq

ZeroMQ PUB/SUB input/output plugins
<DFF> @@ -0,0 +1,30 @@
+require 'ffi-rzmq'
+
+module Logstash
+  module Util
+    module Zmq
+
+      CONTEXT = ZMQ::Context.new
+
+      def context
+        CONTEXT
+      end
+
+      def setup(socket, address)
+        if server?
+          error_check(socket.bind(address))
+        else
+          error_check(socket.connect(address))
+        end
+        @logger.info("0mq: #{server? ? 'connected' : 'bound'}", :address => address)
+      end
+
+      def error_check(rc)
+        unless ZMQ::Util.resultcode_ok?(rc)
+          @logger.error("ZMQ error: ", { :error_code => rc })
+          raise "ZMQ Error"
+        end
+      end
+    end
+  end
+end
\ No newline at end of file

Merge pull request #79 from masterzen/feature/zeromq