Skip to main content

reifydb_core/actors/
flow.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2026 ReifyDB
3
4use std::{collections::BTreeSet, sync::Arc};
5
6use reifydb_runtime::actor::system::ActorHandle;
7use reifydb_value::Result;
8
9use crate::{
10	common::CommitVersion,
11	interface::{catalog::object::ObjectId, cdc::Cdc},
12};
13
14pub type FlowActorHandle = ActorHandle<FlowActorMessage>;
15
16pub enum FlowActorMessage {
17	Drain,
18
19	Wake,
20
21	TrailingWake,
22
23	Loaded {
24		outcome: Result<(Vec<Arc<Cdc>>, CommitVersion)>,
25	},
26
27	Tick,
28
29	LingerDue,
30
31	Sample,
32
33	PublishRestoredFrontiers,
34
35	UpdateSources {
36		source_objects: Arc<BTreeSet<ObjectId>>,
37		completeness_objects: Option<Arc<BTreeSet<u64>>>,
38	},
39
40	SliceCommitted {
41		advance_to: CommitVersion,
42		more: bool,
43		result: Result<()>,
44		committed: Option<CommitVersion>,
45	},
46
47	TickCommitted {
48		result: Result<()>,
49	},
50
51	Stop {
52		delete_checkpoint: bool,
53		reply: Box<dyn FnOnce() + Send>,
54	},
55}