Class: Qpid::Proton::Session
Overview
A session is the parent for senders and receivers.
A Session has a single parent Qpid::Proton::Connection instance.
Constant Summary
Constants inherited from Endpoint
Endpoint::LOCAL_ACTIVE, Endpoint::LOCAL_CLOSED, Endpoint::LOCAL_MASK, Endpoint::LOCAL_UNINIT, Endpoint::REMOTE_ACTIVE, Endpoint::REMOTE_CLOSED, Endpoint::REMOTE_MASK, Endpoint::REMOTE_UNINIT
Instance Attribute Summary collapse
-
#incoming_bytes ⇒ Fixnum
readonly
The number of incomign bytes currently being buffered.
-
#incoming_capacity ⇒ Fixnum
The incoming capacity of a session determines how much incoming message data the session will buffer.
-
#outgoing_bytes ⇒ Fixnum
readonly
The number of outgoing bytes currently being buffered.
-
#state ⇒ Fixnum
readonly
The endpoint state.
Instance Method Summary collapse
-
#close ⇒ Object
Closed the session.
-
#connection ⇒ Connection
Returns the parent connection.
-
#next(state_mask) ⇒ Session?
Retrieves the next session from a given connection that matches the specified state mask.
-
#open ⇒ Object
Opens the session.
-
#receiver(name) ⇒ Receiver?
Constructs a new receiver.
-
#sender(name) ⇒ Sender?
Constructs a new sender.
Methods inherited from Endpoint
#check_state, #handler, #handler=, #local_active?, #local_closed?, #local_uninit?, #remote_active?, #remote_closed?, #remote_uninit?, #transport
Instance Attribute Details
#incoming_bytes ⇒ Fixnum (readonly)
Returns The number of incomign bytes currently being buffered.
61 |
# File 'lib/core/session.rb', line 61 proton_caller :incoming_bytes |
#incoming_capacity ⇒ Fixnum
The incoming capacity of a session determines how much incoming message data the session will buffer. Note that if this value is less than the negotatied frame size of the transport, it will be rounded up to one full frame.
46 |
# File 'lib/core/session.rb', line 46 proton_accessor :incoming_capacity |
#outgoing_bytes ⇒ Fixnum (readonly)
Returns The number of outgoing bytes currently being buffered.
55 |
# File 'lib/core/session.rb', line 55 proton_caller :outgoing_bytes |
#state ⇒ Fixnum (readonly)
Returns The endpoint state.
76 |
# File 'lib/core/session.rb', line 76 proton_caller :state |
Instance Method Details
#close ⇒ Object
Closed the session.
Once this operation has completed, the state flag will be set. This may be called without calling #open, in which case it is the equivalence of calling #open and then close immediately.
96 97 98 99 |
# File 'lib/core/session.rb', line 96 def close self._update_condition Cproton.pn_session_close(@impl) end |
#connection ⇒ Connection
Returns the parent connection.
119 120 121 |
# File 'lib/core/session.rb', line 119 def connection Connection.wrap(Cproton.pn_session_connection(@impl)) end |
#next(state_mask) ⇒ Session?
Retrieves the next session from a given connection that matches the specified state mask.
When uses with Connection#session_head an application can access all of the session son the connection that match the given state.
111 112 113 |
# File 'lib/core/session.rb', line 111 def next(state_mask) Session.wrap(Cproton.pn_session_next(@impl, state_mask)) end |
#open ⇒ Object
Opens the session.
Once this operaton has completed, the state flag is updated.
70 |
# File 'lib/core/session.rb', line 70 proton_caller :open |
#receiver(name) ⇒ Receiver?
Constructs a new receiver.
Each receiver between two AMQP containers must be uniquely named. Note that this uniqueness cannot be enforced at the library level, so some consideration should be taken in choosing link names.
147 148 149 |
# File 'lib/core/session.rb', line 147 def receiver(name) Receiver.new(Cproton.pn_receiver(@impl, name)) end |
#sender(name) ⇒ Sender?
Constructs a new sender.
Each sender between two AMQP containers must be uniquely named. Note that this uniqueness cannot be enforced at the library level, so some consideration should be taken in choosing link names.
133 134 135 |
# File 'lib/core/session.rb', line 133 def sender(name) Sender.new(Cproton.pn_sender(@impl, name)) end |