iota_data_ingestion/workers/relay.rs
1// Copyright (c) Mysten Labs, Inc.
2// Modifications Copyright (c) 2024 IOTA Stiftung
3// SPDX-License-Identifier: Apache-2.0
4//! Simple logic for relaying checkpoint data without any side effects.
5
6use std::sync::Arc;
7
8use async_trait::async_trait;
9use iota_data_ingestion_core::Worker;
10use iota_types::full_checkpoint_content::CheckpointData;
11
12/// Simple worker that relays checkpoint data without any side effects.
13pub struct RelayWorker;
14#[async_trait]
15impl Worker for RelayWorker {
16 type Message = Arc<CheckpointData>;
17 type Error = anyhow::Error;
18
19 async fn process_checkpoint(
20 &self,
21 checkpoint: Arc<CheckpointData>,
22 ) -> Result<Self::Message, Self::Error> {
23 Ok(checkpoint)
24 }
25}