use reifydb_core::{
common::CommitVersion,
interface::{catalog::flow::FlowId, change::Change},
};
#[derive(Clone, Debug)]
pub struct FlowInstruction {
pub flow_id: FlowId,
pub to_version: CommitVersion,
pub changes: Vec<Change>,
}
impl FlowInstruction {
pub fn new(flow_id: FlowId, to_version: CommitVersion, changes: Vec<Change>) -> Self {
Self {
flow_id,
to_version,
changes,
}
}
}
#[derive(Clone, Debug)]
pub struct WorkerBatch {
pub state_version: CommitVersion,
pub instructions: Vec<FlowInstruction>,
}
impl WorkerBatch {
pub fn new(state_version: CommitVersion) -> Self {
Self {
state_version,
instructions: Vec::new(),
}
}
pub fn add_instruction(&mut self, instruction: FlowInstruction) {
self.instructions.push(instruction);
}
}