Class Qpid::Proton::ConnectionDriver
In: lib/core/connection_driver.rb
Parent: Object

Associate an AMQP {Connection} and {Transport} with an {IO}

  • {read} reads AMQP binary data from the {IO} and generates events
  • {tick} generates timing-related events
  • {event} gets events to be dispatched to {Handler::MessagingHandler}s
  • {write} writes AMQP binary data to the {IO}

Thread safety: The {ConnectionDriver} is not thread safe but separate {ConnectionDriver} instances can be processed concurrently. The {Container} handles multiple connections concurrently in multiple threads.

Methods

Public Class methods

Create a {Connection} and {Transport} associated with io @param io [IO] An {IO} or {IO}-like object that responds

  to {IO#read_nonblock} and {IO#write_nonblock}

Public Instance methods

@return [Bool] True if the driver can read more data

@return [Bool] True if the driver has data to write

Disconnect both sides of the transport sending/waiting for AMQP close frames. See comments on {close_write}

Disconnect the read side of the transport, without waiting for an AMQP close frame. See comments on {close_write}

Disconnect the write side of the transport, without sending an AMQP close frame. To close politely, you should use {Connection#close}, the transport will close itself once the protocol close is complete.

Iterator for all available events

Get the next event to dispatch, nil if no events available

True if {event} will return non-nil

True if the ConnectionDriver has nothing left to do: both sides of the transport are closed and there are no events to dispatch.

Non-blocking read from {io}, generate events for {event} IO errors are returned as transport errors by {event}, not raised

Is the read side of the driver closed?

Handle time-related work, for example idle-timeout events. May generate events for {event} and change {can_read?}, {can_write?}

@param [Time] now the current time, defaults to {Time#now}.

@return [Time] time of the next scheduled event, or nil if there are no scheduled events. If non-nil you must call {tick} again no later than this time.

@return [IO] Allows ConnectionDriver to be passed directly to {IO#select}

Non-blocking write to {io} IO errors are returned as transport errors by {event}, not raised

Is the write side of the driver closed?

[Validate]