prodigy 0.4.4

Turn ad-hoc Claude sessions into reproducible development pipelines with parallel AI agents
Documentation
//! No-op event writer for fallback scenarios

use crate::cook::execution::events::{EventRecord, EventWriter};
use anyhow::Result;
use async_trait::async_trait;

/// A no-op event writer that silently discards all events
/// Used as a last resort when no other event writer can be created
#[derive(Clone)]
pub struct NoOpEventWriter;

impl Default for NoOpEventWriter {
    fn default() -> Self {
        Self::new()
    }
}

impl NoOpEventWriter {
    pub fn new() -> Self {
        Self
    }
}

#[async_trait]
impl EventWriter for NoOpEventWriter {
    async fn write(&self, _events: &[EventRecord]) -> Result<()> {
        // Silently discard the events
        Ok(())
    }

    async fn flush(&self) -> Result<()> {
        // Nothing to flush
        Ok(())
    }

    fn clone(&self) -> Box<dyn EventWriter> {
        Box::new(Self)
    }
}