Struct dyer::engine::App[][src]

pub struct App<Entity, T, P> where
    T: Serialize + for<'de> Deserialize<'de> + Debug + Clone,
    P: Serialize + for<'de> Deserialize<'de> + Debug + Clone
{ pub task: Arc<Mutex<Vec<Task<T>>>>, pub task_tmp: Arc<Mutex<Vec<Task<T>>>>, pub profile: Arc<Mutex<Vec<Profile<P>>>>, pub req: Arc<Mutex<Vec<Request<T, P>>>>, pub req_tmp: Arc<Mutex<Vec<Request<T, P>>>>, pub res: Arc<Mutex<Vec<Response<T, P>>>>, pub result: Arc<Mutex<Vec<Entity>>>, pub yield_err: Arc<Mutex<Vec<String>>>, pub fut_res: Arc<Mutex<Vec<(u64, JoinHandle<()>)>>>, pub fut_profile: Arc<Mutex<Vec<(u64, JoinHandle<()>)>>>, pub rt_args: Arc<Mutex<AppArg>>, }

An abstraction and collection of data flow of Dyer,

Fields

task: Arc<Mutex<Vec<Task<T>>>>task_tmp: Arc<Mutex<Vec<Task<T>>>>profile: Arc<Mutex<Vec<Profile<P>>>>req: Arc<Mutex<Vec<Request<T, P>>>>req_tmp: Arc<Mutex<Vec<Request<T, P>>>>res: Arc<Mutex<Vec<Response<T, P>>>>result: Arc<Mutex<Vec<Entity>>>yield_err: Arc<Mutex<Vec<String>>>fut_res: Arc<Mutex<Vec<(u64, JoinHandle<()>)>>>fut_profile: Arc<Mutex<Vec<(u64, JoinHandle<()>)>>>rt_args: Arc<Mutex<AppArg>>

Implementations

impl<'a, Entity, T, P> App<Entity, T, P> where
    T: 'static + Serialize + for<'de> Deserialize<'de> + Debug + Clone + Sync + Send,
    P: 'static + Serialize + for<'de> Deserialize<'de> + Debug + Clone + Sync + Send,
    Entity: Serialize + Debug + Clone + Send + Sync
[src]

pub fn new() -> Self[src]

pub fn info(&mut self)[src]

get the overview of App

pub fn enough_profile(&self) -> bool[src]

to see whether to generate Profile

pub async fn plineout<C>(&mut self, pipeline: &PipeLine<'a, Entity, C>) where
    C: Send + 'a, 
[src]

drive and consume extracted Entity into PipeLine

pub async fn update_req(&mut self, middleware: &MiddleWare<'a, Entity, T, P>)[src]

load and balance Request

pub async fn spawn_task(&mut self)[src]

spawn polling Request as tokio::task and executing asynchronously,

pub fn buf_task(&self, path: &str) -> Vec<usize>[src]

load cached Task from caced directory

pub async fn close<'b, C>(
    &'a mut self,
    spd: &'static dyn Spider<Entity, T, P>,
    middleware: &'a MiddleWare<'b, Entity, T, P>,
    pipeline: &'a PipeLine<'b, Entity, C>
) where
    C: Send + 'b, 
[src]

preparation before closing Dyer

pub async fn run<'b, C>(
    &'a mut self,
    spd: &'static dyn Spider<Entity, T, P>,
    middleware: &'a MiddleWare<'b, Entity, T, P>,
    pipeline: PipeLine<'b, Entity, C>
) -> Result<(), Box<dyn Error + Send + Sync>> where
    C: Send + 'a, 
[src]

drive Dyer into running.

Auto Trait Implementations

impl<Entity, T, P> RefUnwindSafe for App<Entity, T, P>

impl<Entity, T, P> Send for App<Entity, T, P> where
    Entity: Send,
    T: Send

impl<Entity, T, P> Sync for App<Entity, T, P> where
    Entity: Send,
    T: Send

impl<Entity, T, P> Unpin for App<Entity, T, P>

impl<Entity, T, P> UnwindSafe for App<Entity, T, P>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,