Skip to content

Commit 5a8485f

Browse files
authored
Refactor streaming support (ntex-rs#202)
1 parent 869cd37 commit 5a8485f

File tree

12 files changed

+326
-421
lines changed

12 files changed

+326
-421
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
## [5.2.0] - 2025-05-08
4+
5+
* Refactor stream support in publish builder
6+
37
## [5.1.0] - 2025-05-05
48

59
* Fix .read_all() method return type

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntex-mqtt"
3-
version = "5.1.0"
3+
version = "5.2.0"
44
authors = ["ntex contributors <team@ntex.rs>"]
55
description = "Client and Server framework for MQTT v5 and v3.1.1 protocols"
66
documentation = "https://docs.rs/ntex-mqtt"

examples/mqtt-ws-client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async fn main() -> std::io::Result<()> {
6363
});
6464
ntex::rt::spawn(router.start_default());
6565

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

6969
sleep(Millis(10_000)).await;

examples/openssl-client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async fn main() -> std::io::Result<()> {
4545
let router = client.resource("response", publish);
4646
ntex::rt::spawn(router.start_default());
4747

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

5050
sleep(Millis(10_000)).await;
5151

examples/subs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ async fn publish(
6060
let payload = publish.read_all().await.unwrap();
6161
session
6262
.sink
63-
.publish(publish.packet().topic.clone(), payload)
64-
.send_at_least_once()
63+
.publish(publish.packet().topic.clone())
64+
.send_at_least_once(payload)
6565
.await
6666
.unwrap();
6767
}

examples/subs_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ async fn main() -> std::io::Result<()> {
8383
.unwrap();
8484

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

8989
sleep(Millis(1_000)).await;

0 commit comments

Comments
 (0)