Sha256: b2dd58fd367ec41e6f98d1f658d1f581ee6b7a846ab4265230c8ac048342df1b
Contents?: true
Size: 739 Bytes
Versions: 19
Compression:
Stored size: 739 Bytes
Contents
require 'asir/transport/delegation' module ASIR class Transport # !SLIDE # Select a Transport based on a Proc. class Demux < self include Delegation # Proc returning actual transport to use. # transport_proc.call(transport, message) attr_accessor :transport_proc # Only active during #send_message. attr_accessor_thread :transport # Support for Delegation mixin. def transports; [ transport ]; end def send_message message with_attr! :transport, transport_proc.call(self, message) do super end end def _send_message message, message_payload transport.send_message(message) end end # !SLIDE END end end
Version data entries
19 entries across 19 versions & 1 rubygems