use chrono::{DateTime, Utc};
use everruns_engine::{
ActivityOutcome, Execution, ExecutionTransition, HostFacts, TurnExecution, TurnState,
};
#[derive(Debug, Clone)]
pub struct InProcessExecution {
inner: TurnExecution,
}
impl InProcessExecution {
pub fn new(state: TurnState) -> Self {
Self {
inner: TurnExecution::new(state),
}
}
pub fn into_state(self) -> TurnState {
self.inner.into_state()
}
}
impl Execution for InProcessExecution {
fn state(&self) -> &TurnState {
self.inner.state()
}
fn advance(
&mut self,
outcome: ActivityOutcome,
pending_user_message_count: usize,
now: DateTime<Utc>,
facts: HostFacts,
) -> ExecutionTransition {
self.inner
.advance(outcome, pending_user_message_count, now, facts)
}
}