Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
brayniac committed Sep 24, 2024
1 parent bf50135 commit 6bb6163
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/clients/cache/memcache/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::clients::ResponseError;
use super::*;
use crate::clients::ResponseError;
use crate::net::Connector;
use protocol_memcache::{Compose, Parse, Request, Response, Ttl};
use session::{Buf, BufMut, Buffer};
Expand Down
12 changes: 3 additions & 9 deletions src/clients/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,12 @@ pub fn launch(
.expect("failed to initialize tokio runtime");

match config.general().protocol() {
Protocol::Memcache => {
memcache::launch_tasks(&mut client_rt, config.clone(), work_receiver)
}
Protocol::Momento => {
momento::launch_tasks(&mut client_rt, config.clone(), work_receiver)
}
Protocol::Memcache => memcache::launch_tasks(&mut client_rt, config.clone(), work_receiver),
Protocol::Momento => momento::launch_tasks(&mut client_rt, config.clone(), work_receiver),
Protocol::Ping => {
crate::clients::ping::ascii::launch_tasks(&mut client_rt, config.clone(), work_receiver)
}
Protocol::Resp => {
redis::launch_tasks(&mut client_rt, config.clone(), work_receiver)
}
Protocol::Resp => redis::launch_tasks(&mut client_rt, config.clone(), work_receiver),
protocol => {
error!("keyspace is not supported for the {:?} protocol", protocol);
std::process::exit(1);
Expand Down
2 changes: 1 addition & 1 deletion src/clients/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ impl From<MomentoError> for ResponseError {
_ => ResponseError::Exception,
}
}
}
}
18 changes: 9 additions & 9 deletions src/clients/ping/ascii.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
use std::io::ErrorKind;
use crate::clients::*;
use tokio::io::AsyncReadExt;
use tokio::io::AsyncWriteExt;
use std::time::Instant;
use std::io::{Error, Result};
use tokio::time::timeout;
use crate::net::Connector;
use crate::workload::*;
use async_channel::Receiver;
use tokio::runtime::Runtime;
use crate::*;
use crate::net::Connector;
use async_channel::Receiver;
use protocol_ping::{Compose, Parse, Request, Response};
use session::{Buf, BufMut, Buffer};
use std::borrow::{Borrow, BorrowMut};
use std::io::ErrorKind;
use std::io::{Error, Result};
use std::time::Instant;
use tokio::io::AsyncReadExt;
use tokio::io::AsyncWriteExt;
use tokio::runtime::Runtime;
use tokio::time::timeout;

/// Launch tasks with one conncetion per task as ping protocol is not mux-enabled.
pub fn launch_tasks(
Expand Down
2 changes: 1 addition & 1 deletion src/clients/ping/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub mod ascii;
pub mod ascii;
5 changes: 4 additions & 1 deletion src/clients/pubsub/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ fn launch_publishers(
kafka::launch_publishers(&mut publisher_rt, config.clone(), work_receiver);
}
protocol => {
error!("pubsub is not supported for the selected protocol: {:?}", protocol);
error!(
"pubsub is not supported for the selected protocol: {:?}",
protocol
);
std::process::exit(1);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/clients/pubsub/momento.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::clients::pubsub::*;
use async_channel::Receiver;
use crate::clients::*;
use crate::workload::*;
use async_channel::Receiver;
use tokio::runtime::Runtime;
use crate::clients::*;

use ::momento::topics::configurations::LowLatency;
use ::momento::topics::{TopicClient, ValueKind};
Expand Down
5 changes: 4 additions & 1 deletion src/clients/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ pub fn launch(
match config.general().protocol() {
Protocol::Momento => momento::launch_tasks(&mut client_rt, config.clone(), work_receiver),
protocol => {
error!("store commands are not supported for the {:?} protocol", protocol);
error!(
"store commands are not supported for the {:?} protocol",
protocol
);
std::process::exit(1);
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/clients/store/momento.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
use crate::clients::*;
use crate::*;
use crate::workload::*;
use crate::*;

use async_channel::Receiver;
use tokio::runtime::Runtime;
use ::momento::storage::configurations::LowLatency;
use ::momento::storage::PutRequest;
use ::momento::*;
use async_channel::Receiver;
use paste::paste;
use ::momento::storage::PutRequest;
use storage::GetResponse;
use tokio::runtime::Runtime;
use tokio::time::timeout;

use std::time::Instant;
use std::io::{Error, Result};
use std::time::Instant;

/// Launch tasks with one channel per task as gRPC is mux-enabled.
pub fn launch_tasks(
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ fn main() {
let store_runtime = clients::store::launch(&config, store_receiver);

// start publisher(s) and subscriber(s)
let mut pubsub_runtimes = clients::pubsub::launch(&config, pubsub_receiver, &workload_components);
let mut pubsub_runtimes =
clients::pubsub::launch(&config, pubsub_receiver, &workload_components);

// start ratelimit controller thread if a dynamic ratelimit is configured
{
Expand Down

0 comments on commit 6bb6163

Please sign in to comment.