Skip to content

Commit

Permalink
binary and delimited serialization of prost messages in channels
Browse files Browse the repository at this point in the history
Co-Authored-By: Eloi DEMOLIS <eloi.demolis@clever-cloud.com>
  • Loading branch information
Keksoj and Wonshtrum committed Feb 2, 2024
1 parent 630b1a7 commit a6ffebe
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 180 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ nom = "^7.1.3"
paw = "^1.0.0"
serde = { version = "^1.0.195", features = ["derive"] }
serde_json = "^1.0.111"
prost = "^0.12.3"
time = "^0.3.29"
tempfile = "^3.9.0"
termion = "^3.0.0"
Expand Down
6 changes: 3 additions & 3 deletions bin/src/command/sessions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::fmt::Debug;

use libc::pid_t;
use mio::Token;
use serde::{de::DeserializeOwned, Serialize};
use prost::Message;

use sozu_command_lib::{
channel::Channel,
Expand Down Expand Up @@ -265,8 +265,8 @@ impl WorkerSession {
/// read and parse messages (Requests or Responses) from the channel
pub fn extract_messages<Tx, Rx>(channel: &mut Channel<Tx, Rx>) -> Vec<Rx>
where
Tx: Debug + Serialize,
Rx: Debug + DeserializeOwned,
Tx: Debug + Default + Message,
Rx: Debug + Default + Message,
{
let mut messages = Vec::new();
loop {
Expand Down

0 comments on commit a6ffebe

Please sign in to comment.