Sha256: c51f83dd1cdd66bd7d08fed76c29b9985e862ca946925c39a863b138f493cf23
Contents?: true
Size: 1.16 KB
Versions: 15
Compression:
Stored size: 1.16 KB
Contents
# frozen_string_literal: true module RubyRabbitmqJanus module Janus module Transactions # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv> # # # Manage a transaction # # Manage a transaction with message if contains a session identifier class Session < Transaction # Initialize a transaction with handle # # @param [Fixnum] session # Use a session identifier for created message def initialize(exclusive, session) super(session) @exclusive = exclusive end # Opening a short transaction with rabbitmq and close when is ending # # @yield Send a message to Janus def connect rabbit.transaction_short do choose_queue yield end end def publish_message(type, options = {}) msg = Janus::Messages::Standard.new(type, opts.merge!(options)) response = read_response(publisher.publish(msg)) Janus::Responses::Standard.new(response) end private def opts { 'session_id' => session } end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems