[−][src]Trait transact::scheduler::Scheduler
Schedules batches and transactions and returns execution results.
Required methods
fn set_result_callback(
&mut self,
callback: Box<dyn Fn(Option<BatchExecutionResult>) + Send>
) -> Result<(), SchedulerError>
&mut self,
callback: Box<dyn Fn(Option<BatchExecutionResult>) + Send>
) -> Result<(), SchedulerError>
Sets a callback to receive results from processing batches. The order
the results are received is not guarenteed to be the same order as the
batches were added with add_batch
. If callback is called with None,
all batch results have been sent (only used when the scheduler has been
finalized and no more batches will be added).
fn set_error_callback(
&mut self,
callback: Box<dyn Fn(SchedulerError) + Send>
) -> Result<(), SchedulerError>
&mut self,
callback: Box<dyn Fn(SchedulerError) + Send>
) -> Result<(), SchedulerError>
Sets a callback to receive any errors encountered by the Scheduler that are not related to a specific batch.
fn add_batch(&mut self, batch: BatchPair) -> Result<(), SchedulerError>
Adds a BatchPair to the scheduler.
fn cancel(&mut self) -> Result<Vec<BatchPair>, SchedulerError>
Drops any unscheduled transactions from this scheduler. Any already scheduled transactions will continue to execute.
Returns a Vec
of the dropped BatchPair
s.
fn finalize(&mut self) -> Result<(), SchedulerError>
Finalizes the scheduler, which will disable the ability to add more
batches. After this is called, add_batch()
will be return a
FinalizedSchedulerError.
fn take_task_iterator(
&mut self
) -> Result<Box<dyn Iterator<Item = ExecutionTask> + Send>, SchedulerError>
&mut self
) -> Result<Box<dyn Iterator<Item = ExecutionTask> + Send>, SchedulerError>
Returns an iterator that returns transactions to be executed.
fn new_notifier(
&mut self
) -> Result<Box<dyn ExecutionTaskCompletionNotifier>, SchedulerError>
&mut self
) -> Result<Box<dyn ExecutionTaskCompletionNotifier>, SchedulerError>
Returns a newly allocated ExecutionTaskCompletionNotifier which allows sending a notification to the scheduler that indicates the task has been executed.
Implementors
impl Scheduler for MultiScheduler
[src]
fn set_result_callback(
&mut self,
callback: Box<dyn Fn(Option<BatchExecutionResult>) + Send>
) -> Result<(), SchedulerError>
[src]
&mut self,
callback: Box<dyn Fn(Option<BatchExecutionResult>) + Send>
) -> Result<(), SchedulerError>
fn set_error_callback(
&mut self,
callback: Box<dyn Fn(SchedulerError) + Send>
) -> Result<(), SchedulerError>
[src]
&mut self,
callback: Box<dyn Fn(SchedulerError) + Send>
) -> Result<(), SchedulerError>
fn add_batch(&mut self, batch: BatchPair) -> Result<(), SchedulerError>
[src]
fn cancel(&mut self) -> Result<Vec<BatchPair>, SchedulerError>
[src]
fn finalize(&mut self) -> Result<(), SchedulerError>
[src]
fn take_task_iterator(
&mut self
) -> Result<Box<dyn Iterator<Item = ExecutionTask> + Send>, SchedulerError>
[src]
&mut self
) -> Result<Box<dyn Iterator<Item = ExecutionTask> + Send>, SchedulerError>
fn new_notifier(
&mut self
) -> Result<Box<dyn ExecutionTaskCompletionNotifier>, SchedulerError>
[src]
&mut self
) -> Result<Box<dyn ExecutionTaskCompletionNotifier>, SchedulerError>
impl Scheduler for SerialScheduler
[src]
fn set_result_callback(
&mut self,
callback: Box<dyn Fn(Option<BatchExecutionResult>) + Send>
) -> Result<(), SchedulerError>
[src]
&mut self,
callback: Box<dyn Fn(Option<BatchExecutionResult>) + Send>
) -> Result<(), SchedulerError>
fn set_error_callback(
&mut self,
callback: Box<dyn Fn(SchedulerError) + Send>
) -> Result<(), SchedulerError>
[src]
&mut self,
callback: Box<dyn Fn(SchedulerError) + Send>
) -> Result<(), SchedulerError>
fn add_batch(&mut self, batch: BatchPair) -> Result<(), SchedulerError>
[src]
fn cancel(&mut self) -> Result<Vec<BatchPair>, SchedulerError>
[src]
fn finalize(&mut self) -> Result<(), SchedulerError>
[src]
fn take_task_iterator(
&mut self
) -> Result<Box<dyn Iterator<Item = ExecutionTask> + Send>, SchedulerError>
[src]
&mut self
) -> Result<Box<dyn Iterator<Item = ExecutionTask> + Send>, SchedulerError>
fn new_notifier(
&mut self
) -> Result<Box<dyn ExecutionTaskCompletionNotifier>, SchedulerError>
[src]
&mut self
) -> Result<Box<dyn ExecutionTaskCompletionNotifier>, SchedulerError>