mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
Run cargo fmt
This commit is contained in:
parent
aaa609b5f0
commit
072f064138
4 changed files with 38 additions and 31 deletions
|
|
@ -1,5 +1,5 @@
|
|||
//! Work-in-progress glommio (io_uring) implementation
|
||||
//!
|
||||
//!
|
||||
//! * Doesn't support scrape requests
|
||||
//! * Currently not faster than mio implementation
|
||||
|
||||
|
|
@ -18,9 +18,9 @@ pub const SHARED_CHANNEL_SIZE: usize = 4096;
|
|||
|
||||
pub fn run(config: Config) -> anyhow::Result<()> {
|
||||
if config.core_affinity.set_affinities {
|
||||
core_affinity::set_for_current(
|
||||
core_affinity::CoreId { id: config.core_affinity.offset }
|
||||
);
|
||||
core_affinity::set_for_current(core_affinity::CoreId {
|
||||
id: config.core_affinity.offset,
|
||||
});
|
||||
}
|
||||
|
||||
let num_peers = config.socket_workers + config.request_workers;
|
||||
|
|
@ -65,7 +65,8 @@ pub fn run(config: Config) -> anyhow::Result<()> {
|
|||
let mut builder = LocalExecutorBuilder::default();
|
||||
|
||||
if config.core_affinity.set_affinities {
|
||||
builder = builder.pin_to_cpu(config.core_affinity.offset + 1 + config.socket_workers + i);
|
||||
builder =
|
||||
builder.pin_to_cpu(config.core_affinity.offset + 1 + config.socket_workers + i);
|
||||
}
|
||||
|
||||
let executor = builder.spawn(|| async move {
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ use std::sync::{
|
|||
use std::time::Duration;
|
||||
|
||||
use futures_lite::{Stream, StreamExt};
|
||||
use glommio::enclose;
|
||||
use glommio::channels::channel_mesh::{MeshBuilder, Partial, Role, Senders};
|
||||
use glommio::channels::local_channel::{new_unbounded, LocalSender};
|
||||
use glommio::enclose;
|
||||
use glommio::net::UdpSocket;
|
||||
use glommio::prelude::*;
|
||||
use glommio::timer::TimerActionRepeat;
|
||||
|
|
@ -127,7 +127,11 @@ async fn read_requests(
|
|||
Ok(Request::Connect(request)) => {
|
||||
let connection_id = ConnectionId(rng.gen());
|
||||
|
||||
connections.borrow_mut().insert(connection_id, src, connection_valid_until.borrow().to_owned());
|
||||
connections.borrow_mut().insert(
|
||||
connection_id,
|
||||
src,
|
||||
connection_valid_until.borrow().to_owned(),
|
||||
);
|
||||
|
||||
let response = Response::Connect(ConnectResponse {
|
||||
connection_id,
|
||||
|
|
@ -138,7 +142,10 @@ async fn read_requests(
|
|||
}
|
||||
Ok(Request::Announce(request)) => {
|
||||
if connections.borrow().contains(request.connection_id, src) {
|
||||
if access_list.borrow().allows(access_list_mode, &request.info_hash.0) {
|
||||
if access_list
|
||||
.borrow()
|
||||
.allows(access_list_mode, &request.info_hash.0)
|
||||
{
|
||||
let request_consumer_index =
|
||||
(request.info_hash.0[0] as usize) % config.request_workers;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue