Sha256: 92519c7181aa5d5dc5f9c59a8341da556440093c924f6cc01026f79fc60a298a

Contents?: true

Size: 568 Bytes

Versions: 4

Compression:

Stored size: 568 Bytes

Contents

module DeadlySerious
  module Engine
    class SocketSinkSendr < SocketChannel

      attr_reader :io_name

      def initialize(name, _config)
        super
        @io_name = format('tcp://%s:%d', host, port)
        @minion = master.spawn_minion { |ctx| ctx.connect(:PUSH, @io_name) }
        sleep(0.5) # Avoid slow joiner syndrome the stupid way >(
        @minion.send(RDY_MSG)
      end

      def <<(data)
        @minion.send(data.to_s)
        self
      end

      def close
        @minion.send(END_MSG)
        @minion.explode
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
deadly_serious-2.0.0.pre.rc4 lib/deadly_serious/engine/channel/socket/socket_sink_sendr.rb
deadly_serious-2.0.0.pre.rc3 lib/deadly_serious/engine/channel/socket/socket_sink_sendr.rb
deadly_serious-2.0.0.pre.rc2 lib/deadly_serious/engine/channel/socket/socket_sink_sendr.rb
deadly_serious-2.0.0.pre.rc1 lib/deadly_serious/engine/channel/socket/socket_sink_sendr.rb