Expand description
§Tee Service
Production-ready tee (data splitting) stage for the adaptive pipeline. This service provides data inspection and debugging capabilities, useful for:
- Debugging: Inspecting data at specific pipeline stages
- Monitoring: Capturing samples for analysis
- Validation: Verifying transformations at intermediate stages
- Audit Trails: Recording data flow for compliance
§Architecture
This implementation demonstrates the complete pattern for creating pipeline stages:
- Config Struct:
TeeConfigwith typed parameters - FromParameters: Type-safe extraction from HashMap
- Service Struct:
TeeServiceimplementsStageService - Position:
Any(can be placed anywhere in the pipeline) - Reversibility: Pass-through (Forward and Reverse both write + pass data)
§Usage
use adaptive_pipeline::infrastructure::services::TeeService;
use adaptive_pipeline_domain::services::StageService;
let service = TeeService::new();
// Used automatically by pipeline when configured with StageType::Transform§Configuration Parameters
-
output_path (required): Path to write teed data
- Example:
"/tmp/debug-output.bin" - Data will be written to this file (appended if exists)
- Example:
-
format (optional): Output format for teed data
"binary"- Raw binary output (default)"hex"- Hexadecimal dump format"text"- UTF-8 text (lossy conversion for non-UTF8)- Default: “binary”
-
enabled (optional): Whether tee is active
"true"- Tee is active (default)"false"- Tee is disabled (pass-through only)- Allows conditional enable/disable without removing stage
§Performance Characteristics
- Throughput: Limited by I/O speed to tee output
- Overhead: File write operation + optional format conversion
- Memory: Minimal, no buffering
- Latency: Synchronous I/O (blocking writes)
Structs§
- TeeConfig
- Configuration for Tee operations.
- TeeService
- Production Tee service.
Enums§
- TeeFormat
- Output format for teed data.