Class: Arcp::Transport::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/arcp/transport/base.rb

Overview

Abstract transport interface. Implementations carry frames, not message types — decoding is ‘Arcp::Envelope.from_h`.

‘#send` accepts an `Arcp::Envelope` and serializes it. `#receive` suspends the calling fiber until an envelope arrives, then returns it (or nil on clean close).

Instance Method Summary collapse

Instance Method Details

#close(reason: nil) ⇒ Object

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/arcp/transport/base.rb', line 22

def close(reason: nil)
  raise NotImplementedError
end

#closed?Boolean

Returns:

  • (Boolean)


26
# File 'lib/arcp/transport/base.rb', line 26

def closed? = false

#receiveObject

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/arcp/transport/base.rb', line 18

def receive
  raise NotImplementedError
end

#send(envelope) ⇒ Object

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/arcp/transport/base.rb', line 14

def send(envelope)
  raise NotImplementedError
end