class

RNS::PipeInterface

Inherits RNS::Interface < Reference < Object

Interface that communicates with external programs via stdin/stdout pipes. Uses HDLC framing for packetization, matching RNS/Interfaces/PipeInterface.py.

Constants

BITRATE_GUESS = 1000000_i64
DEFAULT_IFAC_SIZE = 8
MAX_CHUNK = 32768

Constructors

new(configuration : Hash(String, String), inbound_callback : Proc(Bytes, Interface, Nil) | Nil = nil)
Source
new(name : String, command : String, respawn_delay : Float64 = 5.0, spawn_process : Bool = true, inbound_callback : Proc(Bytes, Interface, Nil) | Nil = nil)

Constructor for testing: create with explicit parameters, optionally without spawning

Source

Instance methods

command
Source
command=(command : String)
Source
configure_pipe
Source
detach

Called when the interface is being detached/removed

Source
kill_process
Source
open_pipe
Source
pipe_is_open?
Source
process_incoming(data : Bytes)
Source
process_outgoing(data : Bytes)

Send data out through the interface. Subclasses must implement this.

Source
reconnect_pipe
Source
respawn_delay
Source
respawn_delay=(respawn_delay : Float64)
Source
teardown

Tear down the interface, releasing any resources (sockets, fibers, etc.). Subclasses should override to close their specific resources.

Source
to_s(io : IO)

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source