Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.33 #1

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions async-nats/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ categories = ["network-programming", "api-bindings"]
memchr = "2.4"
bytes = { version = "1.4.0", features = ["serde"] }
futures = { version = "0.3.28", default-features = false, features = ["std"] }
nkeys = "0.3.1"
nkeys = "0.1"
once_cell = "1.18.0"
regex = "1.9.1"
serde = { version = "1.0.184", features = ["derive"] }
serde_json = "1.0.104"
serde_repr = "0.1.16"
http = "0.2.9"
tokio = { version = "1.29.0", features = ["macros", "rt", "fs", "net", "sync", "time", "io-util"] }
tokio = { version = "1.14", features = ["macros", "rt", "fs", "net", "sync", "time", "io-util"] }
url = { version = "2"}
tokio-rustls = "0.24"
rustls-pemfile = "1.0.2"
Expand All @@ -47,7 +47,7 @@ rustls = "0.21.6" # used by tokio-rustls 0.24.0
criterion = { version = "0.5", features = ["async_tokio"]}
nats-server = { path = "../nats-server" }
rand = "0.8"
tokio = { version = "1.25.0", features = ["rt-multi-thread"] }
tokio = { version = "1.14", features = ["rt-multi-thread"] }
futures = { version = "0.3.28", default-features = false, features = ["std", "async-await"] }
tracing-subscriber = "0.3"
async-nats = {path = ".", features = ["experimental"]}
Expand Down
8 changes: 5 additions & 3 deletions async-nats/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ use std::slice;
use std::str::{self, FromStr};
use std::task::{Context, Poll};
use tokio::io::ErrorKind;
use tokio::time::{interval, Duration, Interval, MissedTickBehavior};
use tokio::time::{interval, Duration, Interval, MissedTickBehavior, interval_at, Instant};
use url::{Host, Url};

use bytes::Bytes;
Expand Down Expand Up @@ -593,7 +593,7 @@ impl ConnectionHandler {
}

fn handle_server_op(&mut self, server_op: ServerOp) {
self.ping_interval.reset();
self.ping_interval = interval_at(Instant::now(), self.ping_interval.period());

match server_op {
ServerOp::Ping => {
Expand Down Expand Up @@ -693,7 +693,9 @@ impl ConnectionHandler {
}

fn handle_command(&mut self, command: Command) {
self.ping_interval.reset();
self.ping_interval = interval_at(Instant::now(), self.ping_interval.period());



match command {
Command::Unsubscribe { sid, max } => {
Expand Down