Skip to content

Commit

Permalink
Add public constructor for Acker
Browse files Browse the repository at this point in the history
  • Loading branch information
AbstractiveNord authored Mar 18, 2024
1 parent 177c4c7 commit 182efc2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions async-nats/src/jetstream/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ pub struct Acker {
// The async-trait crate is not a solution here, as it would mean we're allocating at every ack.
// Creating separate function to ack just to avoid one duplication is not worth it either.
impl Acker {
pub fn new(context: Context, reply: Option<Subject>) -> Self {
Self { context, reply }
}
/// Acknowledges a message delivery by sending `+ACK` to the server.
///
/// If [AckPolicy][crate::jetstream::consumer::AckPolicy] is set to `All` or `Explicit`, messages has to be acked.
Expand Down

0 comments on commit 182efc2

Please sign in to comment.