Struct dvcompute::simulation::process::ProcessId
source · pub struct ProcessId { /* private fields */ }
Expand description
The computation identifier.
Implementations§
source§impl ProcessId
impl ProcessId
sourcepub fn new() -> NewProcessId
pub fn new() -> NewProcessId
Create a new computation identifier.
sourcepub fn observable(&self) -> Publish<ProcessEvent>
pub fn observable(&self) -> Publish<ProcessEvent>
Returns the observable of computation events.
sourcepub fn cancel_initiating(
&self,
) -> impl Observable<Message = ProcessEvent> + Clone
pub fn cancel_initiating( &self, ) -> impl Observable<Message = ProcessEvent> + Clone
Signal when the cancellation is initiated.
sourcepub fn is_cancel_initiated(
pid: Grc<ProcessId>,
) -> impl Event<Item = bool> + Clone
pub fn is_cancel_initiated( pid: Grc<ProcessId>, ) -> impl Event<Item = bool> + Clone
Whether the cancellation was initiated.
sourcepub fn cancel(pid: Grc<ProcessId>) -> CancelById
pub fn cancel(pid: Grc<ProcessId>) -> CancelById
Cancel a process with the specified identifier.
sourcepub fn begin_preemption(pid: Grc<ProcessId>) -> impl Event<Item = ()> + Clone
pub fn begin_preemption(pid: Grc<ProcessId>) -> impl Event<Item = ()> + Clone
Preempt the computation.
sourcepub fn end_preemption(pid: Grc<ProcessId>) -> impl Event<Item = ()> + Clone
pub fn end_preemption(pid: Grc<ProcessId>) -> impl Event<Item = ()> + Clone
Proceed with the computation after it was preempted earlier.
sourcepub fn preemption_initiating(
&self,
) -> impl Observable<Message = ProcessEvent> + Clone
pub fn preemption_initiating( &self, ) -> impl Observable<Message = ProcessEvent> + Clone
Signal when the computation is preempted.
sourcepub fn preemption_ending(
&self,
) -> impl Observable<Message = ProcessEvent> + Clone
pub fn preemption_ending( &self, ) -> impl Observable<Message = ProcessEvent> + Clone
Signal when the computation is proceeded after it was preempted.
sourcepub fn interrupt(pid: Grc<ProcessId>) -> Interrupt
pub fn interrupt(pid: Grc<ProcessId>) -> Interrupt
Interrupt a process with the specified identifier if the process
is held by computation hold_process
. Returns an Event
computation.
sourcepub fn is_interrupted(pid: Grc<ProcessId>) -> IsInterrupted
pub fn is_interrupted(pid: Grc<ProcessId>) -> IsInterrupted
Test whether the process with the specified identifier was interrupted.
Returns an Event
computation.
sourcepub fn interruption_time(pid: Grc<ProcessId>) -> InterruptionTime
pub fn interruption_time(pid: Grc<ProcessId>) -> InterruptionTime
Return the expected interruption time after finishing the hold_process
computation,
which value may change if the corresponding process is preempted.
Returns an Event
computation.
sourcepub fn is_passivated(pid: Grc<ProcessId>) -> IsPassivated
pub fn is_passivated(pid: Grc<ProcessId>) -> IsPassivated
Test whether the process with the specified identifier was passivated.
Returns an Event
computation.
sourcepub fn reactivate(pid: Grc<ProcessId>) -> Reactivate
pub fn reactivate(pid: Grc<ProcessId>) -> Reactivate
Reactivate a process with the specified identifier.
sourcepub fn reactivate_immediately(pid: Grc<ProcessId>) -> ReactivateImmediately
pub fn reactivate_immediately(pid: Grc<ProcessId>) -> ReactivateImmediately
Reactivate immediately a process with the specified identifier.
sourcepub fn reactivate_many_immediately<I>(
pids: I,
) -> ReactivateManyImmediately<I::IntoIter>
pub fn reactivate_many_immediately<I>( pids: I, ) -> ReactivateManyImmediately<I::IntoIter>
Reactivate immediately the processes with specfified identifies.