Skip to content

Commit

Permalink
Expose sender link credit
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Feb 17, 2022
1 parent 2074abd commit 2749341
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

* Do not store Attach frame in ReceiverLink

* Expose available sender link

* Expose available session remove window size

## [0.6.2] - 2022-01-18

* Allow to change max message size for receiver link
Expand Down
5 changes: 5 additions & 0 deletions src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ impl Session {
&self.inner.get_ref().sink
}

/// Get remote window size
pub fn remote_window_size(&self) -> u32 {
self.inner.get_ref().remote_incoming_window
}

pub fn end(&self) -> impl Future<Output = Result<(), AmqpProtocolError>> {
let inner = self.inner.get_mut();

Expand Down
5 changes: 5 additions & 0 deletions src/sndlink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ impl SenderLink {
&self.inner.get_ref().session
}

/// Returns available send credit
pub fn credit(&self) -> u32 {
self.inner.get_ref().link_credit
}

/// Send body
pub fn send<T>(&self, body: T) -> impl Future<Output = Result<Disposition, AmqpProtocolError>>
where
Expand Down

0 comments on commit 2749341

Please sign in to comment.