Sha256: 4a45602a6013d68bfae2ff5ab89df1139d33cf7630573e7ad7c35b9f0c84fce3

Contents?: true

Size: 441 Bytes

Versions: 6

Compression:

Stored size: 441 Bytes

Contents

class Skein::Client::Publisher < Skein::Connected
  # == Instance Methods =====================================================

  def initialize(queue_name, connection: nil, context: nil)
    super(connection: connection, context: context)

    @queue = self.channel.topic(queue_name)
  end

  def publish!(message, routing_key = nil)
    @queue.publish(JSON.dump(message), routing_key: routing_key)
  end
  alias_method :<<, :publish!
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
skein-0.3.7 lib/skein/client/publisher.rb
skein-0.3.6 lib/skein/client/publisher.rb
skein-0.3.5 lib/skein/client/publisher.rb
skein-0.3.2 lib/skein/client/publisher.rb
skein-0.3.1 lib/skein/client/publisher.rb
skein-0.3.0 lib/skein/client/publisher.rb