Skip to content

Commit

Permalink
Bump tokio-tungstenite from 0.24.0 to 0.26.1 (#2639)
Browse files Browse the repository at this point in the history
* Bump tokio-tungstenite from 0.24.0 to 0.26.1

Bumps [tokio-tungstenite](https://github.com/snapview/tokio-tungstenite) from 0.24.0 to 0.26.1.
- [Changelog](https://github.com/snapview/tokio-tungstenite/blob/master/CHANGELOG.md)
- [Commits](snapview/tokio-tungstenite@v0.24.0...v0.26.1)

---
updated-dependencies:
- dependency-name: tokio-tungstenite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix breaking changes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Guillaume Lagrange <lagrange.guillaume.1@gmail.com>
  • Loading branch information
dependabot[bot] and laggui authored Jan 2, 2025
1 parent fea5e57 commit d9418ad
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 23 deletions.
36 changes: 33 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/burn-remote/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ futures-util = { version = "0.3" }

# Client dependencies
async-channel = { workspace = true, optional = true }
tokio-tungstenite = { version = "0.24", optional = true }
tokio-tungstenite = { version = "0.26", optional = true }

# Server dependencies
axum = { version = "0.7.9", features = ["ws"], optional = true }
Expand Down
39 changes: 20 additions & 19 deletions crates/burn-remote/src/client/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::shared::{ConnectionId, SessionId, Task, TaskResponse, TaskResponseCon
use futures_util::{SinkExt, StreamExt};
use std::{collections::HashMap, sync::Arc};
use tokio_tungstenite::{
connect_async_with_config,
connect_async_with_config, tungstenite,
tungstenite::protocol::{Message, WebSocketConfig},
};

Expand Down Expand Up @@ -56,28 +56,29 @@ impl ClientWorker {
log::info!("Connecting to {address_request} ...");
let (mut stream_request, _) = connect_async_with_config(
address_request.clone(),
Some(WebSocketConfig {
max_send_queue: None,
write_buffer_size: 0,
max_write_buffer_size: usize::MAX,
max_message_size: None,
max_frame_size: Some(MB * 512),
accept_unmasked_frames: true,
}),
Some(
WebSocketConfig::default()
.write_buffer_size(0)
.max_message_size(None)
.max_frame_size(Some(MB * 512))
.accept_unmasked_frames(true)
.read_buffer_size(64 * 1024) // 64 KiB (previous default)
),
true,
)
.await
.expect("Failed to connect");
let (mut stream_response, _) = connect_async_with_config(
address_response,
Some(WebSocketConfig {
max_send_queue: None,
write_buffer_size: 0,
max_write_buffer_size: usize::MAX,
max_message_size: None,
max_frame_size: Some(MB * 512),
accept_unmasked_frames: true,
}),
Some(
WebSocketConfig::default()
.write_buffer_size(0)
.max_message_size(None)
.max_frame_size(Some(MB * 512))
.accept_unmasked_frames(true)
.read_buffer_size(64 * 1024) // 64 KiB (previous default)

),
true,
)
.await
Expand All @@ -87,7 +88,7 @@ impl ClientWorker {

// Init the connection.
let session_id = SessionId::new();
let bytes = rmp_serde::to_vec(&Task::Init(session_id)).expect("Can serialize tasks to bytes.");
let bytes: tungstenite::Bytes = rmp_serde::to_vec(&Task::Init(session_id)).expect("Can serialize tasks to bytes.").into();
stream_request.send(Message::Binary(bytes.clone())).await.expect("Can send the message on the websocket.");
stream_response.send(Message::Binary(bytes)).await.expect("Can send the message on the websocket.");

Expand Down Expand Up @@ -129,7 +130,7 @@ impl ClientWorker {
ClientRequest::WithoutCallback(task) => task,

};
let bytes = rmp_serde::to_vec(&task).expect("Can serialize tasks to bytes.");
let bytes = rmp_serde::to_vec(&task).expect("Can serialize tasks to bytes.").into();
stream_request.send(Message::Binary(bytes)).await.expect("Can send the message on the websocket.");
}
});
Expand Down

0 comments on commit d9418ad

Please # to comment.