pub trait Pipeline: Send + Sync {
// Required methods
fn start(
&mut self,
) -> impl Future<Output = Result<(), IronpostError>> + Send;
fn stop(&mut self) -> impl Future<Output = Result<(), IronpostError>> + Send;
fn health_check(&self) -> impl Future<Output = HealthStatus> + Send;
}Expand description
모든 파이프라인 모듈이 구현하는 생명주기 trait
ironpost-daemon에서 각 모듈을 시작/정지하고 상태를 확인하는 데 사용됩니다.
§구현 예시
ⓘ
struct EbpfPipeline { /* ... */ }
impl Pipeline for EbpfPipeline {
async fn start(&mut self) -> Result<(), IronpostError> {
// XDP 프로그램 로드, 링 버퍼 설정 등
Ok(())
}
async fn stop(&mut self) -> Result<(), IronpostError> {
// 리소스 정리, 프로그램 언로드
Ok(())
}
async fn health_check(&self) -> HealthStatus {
HealthStatus::Healthy
}
}Required Methods§
Sourcefn start(&mut self) -> impl Future<Output = Result<(), IronpostError>> + Send
fn start(&mut self) -> impl Future<Output = Result<(), IronpostError>> + Send
모듈을 시작합니다.
리소스 초기화, 워커 스폰, 채널 연결 등을 수행합니다.
§Errors
이미 실행 중인 경우 PipelineError::AlreadyRunning을 반환합니다.
Sourcefn health_check(&self) -> impl Future<Output = HealthStatus> + Send
fn health_check(&self) -> impl Future<Output = HealthStatus> + Send
모듈의 현재 상태를 확인합니다.
주기적으로 호출되어 모듈의 건강 상태를 모니터링합니다.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.