Sha256: 1b537fe6cc38642d3616ec8de3530938202528e25e355f1f6e269af1a722319d

Contents?: true

Size: 467 Bytes

Versions: 3

Compression:

Stored size: 467 Bytes

Contents

# frozen_string_literal: true

require_relative "base"

module Wamp
  module Manager
    module Event
      # Publish Message Event
      class Publish < Base
        def add_event_listener(&block)
          session.transmit(payload)
          return unless block_given?

          session.on(listen_event_name) do |publication|
            session.off(listen_event_name)
            block.call(publication, nil)
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xconn-0.1.2 lib/wamp/manager/event/publish.rb
xconn-0.1.1 lib/wamp/manager/event/publish.rb
xconn-0.1.0 lib/wamp/manager/event/publish.rb