Method: Farcall::Endpoint#initialize
- Defined in:
- lib/farcall/endpoint.rb
#initialize(transport, init_proc = nil) ⇒ Endpoint
Create endpoint connected to some transport
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/farcall/endpoint.rb', line 24 def initialize(transport, init_proc=nil) @transport = transport @in_serial = @out_serial = 0 @send_lock = Mutex.new @receive_lock = Mutex.new @handlers = {} @waiting = {} init_proc.call(self) if init_proc # @!visibility private def push_input data @in_buffer << data drain end @transport.on_data_received = -> (data) { begin _received(data) rescue abort :format_error, $! end } end |