Class: Qpid::Proton::Session
- Includes:
- Util::SwigHelper, Util::Wrapper
- Defined in:
- lib/core/session.rb
Overview
A session is the parent for senders and receivers.
A Session has a single parent Qpid::Proton::Connection instance.
Constant Summary collapse
- PROTON_METHOD_PREFIX =
"pn_session"
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.
Class Method Summary collapse
Instance Method Summary collapse
- #_local_condition ⇒ Object
- #_remote_condition ⇒ Object
-
#close ⇒ Object
Closed the session.
-
#connection ⇒ Connection
Returns the parent connection.
-
#initialize(impl) ⇒ Session
constructor
A new instance of Session.
-
#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 included from Util::SwigHelper
Methods included from Util::Wrapper
#impl, #impl=, included, registry
Methods inherited from Endpoint
#_update_condition, #check_state, #handler, #handler=, #local_active?, #local_closed?, #local_uninit?, #remote_active?, #remote_closed?, #remote_condition, #remote_uninit?, #transport
Methods included from Util::Engine
#condition_to_object, #data_to_object, #object_to_condition, #object_to_data, receive_message
Constructor Details
#initialize(impl) ⇒ Session
Returns a new instance of Session.
85 86 87 88 |
# File 'lib/core/session.rb', line 85 def initialize(impl) @impl = impl self.class.store_instance(self, :pn_session_attachments) end |
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 |
Class Method Details
Instance Method Details
#_local_condition ⇒ Object
152 153 154 |
# File 'lib/core/session.rb', line 152 def _local_condition Cproton.pn_session_condition(@impl) end |
#_remote_condition ⇒ Object
157 158 159 |
# File 'lib/core/session.rb', line 157 def _remote_condition # :nodoc: Cproton.pn_session_remote_condition(@impl) end |
#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 |