Skip to content

Commit

Permalink
Use a constant for multiplexer sid
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervonb committed Aug 5, 2023
1 parent f7d04f3 commit c5a18c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions async-nats/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ pub type Error = Box<dyn std::error::Error + Send + Sync + 'static>;
const VERSION: &str = env!("CARGO_PKG_VERSION");
const LANG: &str = "rust";
const MAX_PENDING_PINGS: usize = 2;
const MULTIPLEXER_SID: u64 = 0;

/// A re-export of the `rustls` crate used in this crate,
/// for use in cases where manual client configurations
Expand Down Expand Up @@ -644,7 +645,7 @@ impl ConnectionHandler {
if let Err(err) = self
.connection
.write_op(&ClientOp::Subscribe {
sid: 0,
sid: MULTIPLEXER_SID,
subject: subject.clone(),
queue_group: None,
})
Expand Down Expand Up @@ -735,7 +736,7 @@ impl ConnectionHandler {
if let Some(multiplexer) = &self.multiplexer {
self.connection
.write_op(&ClientOp::Subscribe {
sid: 0,
sid: MULTIPLEXER_SID,
subject: multiplexer.subject.to_owned(),
queue_group: None,
})
Expand Down

0 comments on commit c5a18c3

Please sign in to comment.