mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
http_private: move all code in workers::common to common
This commit is contained in:
parent
8478a2b052
commit
c424ffb077
4 changed files with 9 additions and 19 deletions
|
|
@ -3,10 +3,14 @@ use tokio::sync::{mpsc, oneshot};
|
||||||
use aquatic_common::CanonicalSocketAddr;
|
use aquatic_common::CanonicalSocketAddr;
|
||||||
use aquatic_http_protocol::{common::InfoHash, response::Response};
|
use aquatic_http_protocol::{common::InfoHash, response::Response};
|
||||||
|
|
||||||
use crate::{
|
use crate::{config::Config, workers::socket::db::ValidatedAnnounceRequest};
|
||||||
config::Config,
|
|
||||||
workers::{common::ChannelAnnounceRequest, socket::db::ValidatedAnnounceRequest},
|
#[derive(Debug)]
|
||||||
};
|
pub struct ChannelAnnounceRequest {
|
||||||
|
pub request: ValidatedAnnounceRequest,
|
||||||
|
pub source_addr: CanonicalSocketAddr,
|
||||||
|
pub response_sender: oneshot::Sender<Response>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
||||||
pub struct RequestWorkerIndex(pub usize);
|
pub struct RequestWorkerIndex(pub usize);
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
use aquatic_common::CanonicalSocketAddr;
|
|
||||||
use aquatic_http_protocol::response::Response;
|
|
||||||
use tokio::sync::oneshot::Sender;
|
|
||||||
|
|
||||||
use super::socket::db::ValidatedAnnounceRequest;
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct ChannelAnnounceRequest {
|
|
||||||
pub request: ValidatedAnnounceRequest,
|
|
||||||
pub source_addr: CanonicalSocketAddr,
|
|
||||||
pub response_sender: Sender<Response>,
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +1,2 @@
|
||||||
pub mod common;
|
|
||||||
pub mod request;
|
pub mod request;
|
||||||
pub mod socket;
|
pub mod socket;
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,9 @@ use tokio::sync::mpsc::Receiver;
|
||||||
|
|
||||||
use aquatic_http_protocol::response::{FailureResponse, Response};
|
use aquatic_http_protocol::response::{FailureResponse, Response};
|
||||||
|
|
||||||
|
use crate::common::ChannelAnnounceRequest;
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
|
|
||||||
use super::common::ChannelAnnounceRequest;
|
|
||||||
|
|
||||||
pub fn run_request_worker(
|
pub fn run_request_worker(
|
||||||
config: Config,
|
config: Config,
|
||||||
request_receiver: Receiver<ChannelAnnounceRequest>,
|
request_receiver: Receiver<ChannelAnnounceRequest>,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue