Class: Rbgo::IOMachine

Inherits:
Object
  • Object
show all
Defined in:
lib/rbgo/io_machine.rb

Instance Method Summary collapse

Instance Method Details

#closeObject



55
56
57
58
# File 'lib/rbgo/io_machine.rb', line 55

def close
  actor.close
  selector.close
end

#closed?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/rbgo/io_machine.rb', line 60

def closed?
  actor.closed? && selector.closed?
end

#do_read(io, length: nil) ⇒ Object



41
42
43
44
45
46
# File 'lib/rbgo/io_machine.rb', line 41

def do_read(io, length: nil)
  op      = [:register_read, io, length]
  receipt = IOReceipt.new(op)
  actor.send_msg(receipt)
  receipt
end

#do_write(io, str:) ⇒ Object



48
49
50
51
52
53
# File 'lib/rbgo/io_machine.rb', line 48

def do_write(io, str:)
  op      = [:register_write, io, str]
  receipt = IOReceipt.new(op)
  actor.send_msg(receipt)
  receipt
end