Skip to main content

reifydb_core/actors/
cdc.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 ReifyDB
3
4use reifydb_runtime::actor::system::ActorHandle;
5use reifydb_type::{Result, value::datetime::DateTime};
6
7use crate::{common::CommitVersion, delta::Delta};
8
9/// Handle to the CDC producer actor.
10pub type CdcProduceHandle = ActorHandle<CdcProduceMessage>;
11
12/// Message type for the CDC producer actor.
13#[derive(Clone, Debug)]
14pub enum CdcProduceMessage {
15	Produce {
16		version: CommitVersion,
17		changed_at: DateTime,
18		deltas: Vec<Delta>,
19	},
20	Tick,
21}
22
23/// Handle to the CDC consumer poll actor.
24pub type CdcPollHandle = ActorHandle<CdcPollMessage>;
25
26/// Messages for the CDC consumer poll actor.
27pub enum CdcPollMessage {
28	/// Trigger a poll for CDC events
29	Poll,
30	/// Retry watermark readiness check
31	CheckWatermark,
32	/// Async response from the consumer
33	ConsumeResponse(Result<()>),
34}