pub struct ActionQueue<Db, S, TxExec>where
Db: HoprDbInfoOperations + HoprDbTicketOperations + Send + Sync,
S: ActionState + Send + Sync,
TxExec: TransactionExecutor + Send + Sync,{ /* private fields */ }
Expand description
A queue of Actions to be executed.
This queue awaits new Actions to arrive, translates them into Ethereum transactions via TransactionExecutor to execute them and await their confirmation by registering their corresponding expectations in ActionState.
Implementations§
Source§impl<Db, S, TxExec> ActionQueue<Db, S, TxExec>where
Db: HoprDbInfoOperations + HoprDbTicketOperations + Clone + Send + Sync + 'static,
S: ActionState + Send + Sync + 'static,
TxExec: TransactionExecutor + Send + Sync + 'static,
impl<Db, S, TxExec> ActionQueue<Db, S, TxExec>where
Db: HoprDbInfoOperations + HoprDbTicketOperations + Clone + Send + Sync + 'static,
S: ActionState + Send + Sync + 'static,
TxExec: TransactionExecutor + Send + Sync + 'static,
Sourcepub const ACTION_QUEUE_SIZE: usize = 2_048usize
pub const ACTION_QUEUE_SIZE: usize = 2_048usize
Number of pending transactions in the queue
Sourcepub fn new(
db: Db,
action_state: S,
tx_exec: TxExec,
cfg: ActionQueueConfig,
) -> Self
pub fn new( db: Db, action_state: S, tx_exec: TxExec, cfg: ActionQueueConfig, ) -> Self
Creates a new instance with the given TransactionExecutor and ActionState implementations.
Sourcepub fn new_sender(&self) -> ActionSender
pub fn new_sender(&self) -> ActionSender
Creates a new producer of actions for this queue.
Sourcepub fn action_state(&self) -> Arc<S>
pub fn action_state(&self) -> Arc<S>
Clones the ActionState
implementation.
Trait Implementations§
Source§impl<Db, S, TxExec> Clone for ActionQueue<Db, S, TxExec>where
Db: HoprDbInfoOperations + HoprDbTicketOperations + Send + Sync + Clone,
S: ActionState + Send + Sync + Clone,
TxExec: TransactionExecutor + Send + Sync + Clone,
impl<Db, S, TxExec> Clone for ActionQueue<Db, S, TxExec>where
Db: HoprDbInfoOperations + HoprDbTicketOperations + Send + Sync + Clone,
S: ActionState + Send + Sync + Clone,
TxExec: TransactionExecutor + Send + Sync + Clone,
Source§fn clone(&self) -> ActionQueue<Db, S, TxExec>
fn clone(&self) -> ActionQueue<Db, S, TxExec>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<Db, S, TxExec> Debug for ActionQueue<Db, S, TxExec>where
Db: HoprDbInfoOperations + HoprDbTicketOperations + Send + Sync + Debug,
S: ActionState + Send + Sync + Debug,
TxExec: TransactionExecutor + Send + Sync + Debug,
impl<Db, S, TxExec> Debug for ActionQueue<Db, S, TxExec>where
Db: HoprDbInfoOperations + HoprDbTicketOperations + Send + Sync + Debug,
S: ActionState + Send + Sync + Debug,
TxExec: TransactionExecutor + Send + Sync + Debug,
Auto Trait Implementations§
impl<Db, S, TxExec> Freeze for ActionQueue<Db, S, TxExec>where
Db: Freeze,
impl<Db, S, TxExec> RefUnwindSafe for ActionQueue<Db, S, TxExec>
impl<Db, S, TxExec> Send for ActionQueue<Db, S, TxExec>
impl<Db, S, TxExec> Sync for ActionQueue<Db, S, TxExec>
impl<Db, S, TxExec> !Unpin for ActionQueue<Db, S, TxExec>
impl<Db, S, TxExec> UnwindSafe for ActionQueue<Db, S, TxExec>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more