use crate::algorithm::Value;
use crate::process::Process;
use crate::time::Time;
use super::TwoPhaseCommitContext;
use super::TwoPhaseCommitMessage;
#[derive(Debug, PartialEq)]
pub enum TwoPhaseCommitAction<P, V, T>
where
P: Process,
V: Value,
T: Time,
{
Update {
context: TwoPhaseCommitContext<P, T>,
alarm: Option<T>,
},
SendMessage(P, TwoPhaseCommitMessage<V>),
Notify(TwoPhaseCommitActionNotification<V>),
}
#[derive(Debug, Eq, PartialEq)]
pub enum TwoPhaseCommitActionNotification<V>
where
V: Value,
{
Abort(),
Commit(),
MessageDropped(String),
RequestForStart(),
CoordinatorRequestForVote(),
ParticipantRequestForVote(V),
}