Skip to content

Refactor streaming support #202

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

Merged
merged 6 commits into from
May 8, 2025
Merged
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
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## [5.2.0] - 2025-05-08

* Refactor stream support in publish builder

## [5.1.0] - 2025-05-05

* Fix .read_all() method return type
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ntex-mqtt"
version = "5.1.0"
version = "5.2.0"
authors = ["ntex contributors <team@ntex.rs>"]
description = "Client and Server framework for MQTT v5 and v3.1.1 protocols"
documentation = "https://docs.rs/ntex-mqtt"
Expand Down
2 changes: 1 addition & 1 deletion examples/mqtt-ws-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async fn main() -> std::io::Result<()> {
});
ntex::rt::spawn(router.start_default());

sink.publish("test-topic", Bytes::from_static(b"data")).send_at_least_once().await.unwrap();
sink.publish("test-topic").send_at_least_once(Bytes::from_static(b"data")).await.unwrap();
println!("ack is received");

sleep(Millis(10_000)).await;
Expand Down
2 changes: 1 addition & 1 deletion examples/openssl-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async fn main() -> std::io::Result<()> {
let router = client.resource("response", publish);
ntex::rt::spawn(router.start_default());

sink.publish("test-topic", "Publish data".into()).send_at_least_once().await.unwrap();
sink.publish("test-topic").send_at_least_once("Publish data".into()).await.unwrap();

sleep(Millis(10_000)).await;

Expand Down
4 changes: 2 additions & 2 deletions examples/subs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ async fn publish(
let payload = publish.read_all().await.unwrap();
session
.sink
.publish(publish.packet().topic.clone(), payload)
.send_at_least_once()
.publish(publish.packet().topic.clone())
.send_at_least_once(payload)
.await
.unwrap();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/subs_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async fn main() -> std::io::Result<()> {
.unwrap();

log::info!("sending client publish");
let ack = sink.publish("topic1", "Hello world!".into()).send_at_least_once().await.unwrap();
let ack = sink.publish("topic1").send_at_least_once("Hello world!".into()).await.unwrap();
log::info!("ack received: {:?}", ack);

sleep(Millis(1_000)).await;
Expand Down
Loading
Loading