Struct apalis::redis::RedisConsumer[][src]

pub struct RedisConsumer<J> where
    J: 'static + Job + JobHandler<RedisConsumer<J>>, 
{ /* fields omitted */ }

Implementations

impl<J> RedisConsumer<J> where
    J: Job + JobHandler<RedisConsumer<J>>, 
[src]

pub fn new(queue: &Queue<J, RedisStorage>) -> RedisConsumer<J>[src]

pub fn id(&self) -> &String[src]

pub fn data<D>(self, data: D) -> RedisConsumer<J> where
    D: Any + Send + Sync
[src]

pub fn create(url: &str) -> Result<RedisConsumer<J>, RedisError>[src]

pub fn build_producer(&self) -> Addr<RedisProducer<J>>[src]

Trait Implementations

impl<J> Actor for RedisConsumer<J> where
    J: 'static + JobHandler<RedisConsumer<J>> + Job
[src]

type Context = Context<RedisConsumer<J>>

Actor execution context type

pub fn started(&mut self, ctx: &mut Context<RedisConsumer<J>>)[src]

Called when an actor gets polled the first time.

fn stopping(&mut self, ctx: &mut Self::Context) -> Running

Called after an actor is in Actor::Stopping state. Read more

fn stopped(&mut self, ctx: &mut Self::Context)

Called after an actor is stopped. Read more

fn start(self) -> Addr<Self> where
    Self: Actor<Context = Context<Self>>, 

Start a new asynchronous actor, returning its address. Read more

fn start_default() -> Addr<Self> where
    Self: Actor<Context = Context<Self>> + Default

Construct and start a new asynchronous actor, returning its address. Read more

fn start_in_arbiter<F>(arb: &Arbiter, f: F) -> Addr<Self> where
    Self: Actor<Context = Context<Self>>,
    F: FnOnce(&mut Context<Self>) -> Self + Send + 'static, 

Start new actor in arbiter’s thread.

fn create<F>(f: F) -> Addr<Self> where
    Self: Actor<Context = Context<Self>>,
    F: FnOnce(&mut Context<Self>) -> Self, 

Start a new asynchronous actor given a Context. Read more

impl<J> Clone for RedisConsumer<J> where
    J: 'static + Clone + Job + JobHandler<RedisConsumer<J>>, 
[src]

pub fn clone(&self) -> RedisConsumer<J>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<J> Handler<AckJob> for RedisConsumer<J> where
    J: 'static + Unpin + JobHandler<RedisConsumer<J>> + Job
[src]

Implementation of Actix Handler for Get message.

type Result = Pin<Box<dyn Future<Output = Result<Option<bool>, Error>> + 'static, Global>>

The type of value that this handler will return. Read more

pub fn handle(
    &mut self,
    msg: AckJob,
    &mut <RedisConsumer<J> as Actor>::Context
) -> <RedisConsumer<J> as Handler<AckJob>>::Result
[src]

This method is called for every message received by this actor.

impl<J> Handler<RegisterConsumer> for RedisConsumer<J> where
    J: 'static + Unpin + JobHandler<RedisConsumer<J>> + Job
[src]

type Result = Pin<Box<dyn Future<Output = Result<Option<bool>, Error>> + 'static, Global>>

The type of value that this handler will return. Read more

pub fn handle(
    &mut self,
    _msg: RegisterConsumer,
    &mut <RedisConsumer<J> as Actor>::Context
) -> <RedisConsumer<J> as Handler<RegisterConsumer>>::Result
[src]

This method is called for every message received by this actor.

impl<J> Handler<RetryJob> for RedisConsumer<J> where
    J: 'static + Unpin + JobHandler<RedisConsumer<J>> + Job
[src]

Implementation of Actix Handler for retrying jobs

type Result = Pin<Box<dyn Future<Output = Result<Option<i8>, Error>> + 'static, Global>>

The type of value that this handler will return. Read more

pub fn handle(
    &mut self,
    msg: RetryJob,
    &mut <RedisConsumer<J> as Actor>::Context
) -> <RedisConsumer<J> as Handler<RetryJob>>::Result
[src]

This method is called for every message received by this actor.

impl<J> Handler<Stop> for RedisConsumer<J> where
    J: 'static + Unpin + JobHandler<RedisConsumer<J>> + Job
[src]

type Result = ()

The type of value that this handler will return. Read more

pub fn handle(
    &mut self,
    Stop,
    ctx: &mut <RedisConsumer<J> as Actor>::Context
) -> <RedisConsumer<J> as Handler<Stop>>::Result
[src]

This method is called for every message received by this actor.

impl<J> StreamHandler<FetchJob> for RedisConsumer<J> where
    J: 'static + Unpin + JobHandler<RedisConsumer<J>> + Send + Job
[src]

Implementation of Actix Handler fetching jobs.

pub fn handle(
    &mut self,
    _msg: FetchJob,
    ctx: &mut <RedisConsumer<J> as Actor>::Context
)
[src]

Method is called for every message received by this Actor

fn started(&mut self, ctx: &mut Self::Context)

Method is called when stream get polled first time.

fn finished(&mut self, ctx: &mut Self::Context)

Method is called when stream finishes. Read more

fn add_stream<S>(fut: S, ctx: &mut Self::Context) -> SpawnHandle where
    S: Stream<Item = I> + 'static,
    I: 'static,
    Self::Context: AsyncContext<Self>, 

This method register stream to an actor context and allows to handle Stream in similar way as normal actor messages. Read more

impl<J> StreamHandler<HeartBeat> for RedisConsumer<J> where
    J: 'static + Unpin + JobHandler<RedisConsumer<J>> + Job
[src]

pub fn handle(&mut self, HeartBeat, &mut Context<RedisConsumer<J>>)[src]

Method is called for every message received by this Actor

pub fn finished(&mut self, &mut <RedisConsumer<J> as Actor>::Context)[src]

Method is called when stream finishes. Read more

fn started(&mut self, ctx: &mut Self::Context)

Method is called when stream get polled first time.

fn add_stream<S>(fut: S, ctx: &mut Self::Context) -> SpawnHandle where
    S: Stream<Item = I> + 'static,
    I: 'static,
    Self::Context: AsyncContext<Self>, 

This method register stream to an actor context and allows to handle Stream in similar way as normal actor messages. Read more

impl<J> StreamHandler<Schedule> for RedisConsumer<J> where
    J: 'static + Unpin + JobHandler<RedisConsumer<J>> + Job
[src]

pub fn handle(&mut self, Schedule, ctx: &mut Context<RedisConsumer<J>>)[src]

Method is called for every message received by this Actor

pub fn finished(&mut self, &mut <RedisConsumer<J> as Actor>::Context)[src]

Method is called when stream finishes. Read more

fn started(&mut self, ctx: &mut Self::Context)

Method is called when stream get polled first time.

fn add_stream<S>(fut: S, ctx: &mut Self::Context) -> SpawnHandle where
    S: Stream<Item = I> + 'static,
    I: 'static,
    Self::Context: AsyncContext<Self>, 

This method register stream to an actor context and allows to handle Stream in similar way as normal actor messages. Read more

impl<J> Supervised for RedisConsumer<J> where
    J: 'static + Unpin + JobHandler<RedisConsumer<J>> + Job
[src]

pub fn restarting(&mut self, &mut Context<RedisConsumer<J>>)[src]

Called when the supervisor restarts a failed actor.

impl<J> Consumer for RedisConsumer<J> where
    J: 'static + JobHandler<RedisConsumer<J>> + Job
[src]

Auto Trait Implementations

impl<J> RefUnwindSafe for RedisConsumer<J> where
    J: RefUnwindSafe

impl<J> Send for RedisConsumer<J>

impl<J> Sync for RedisConsumer<J> where
    J: Sync

impl<J> Unpin for RedisConsumer<J>

impl<J> UnwindSafe for RedisConsumer<J> where
    J: UnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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

pub fn vzip(self) -> V