Expand description
Internal Service Communication Layer
This module provides the core functionality for integrating internal services within the Citadel Protocol network. It enables bidirectional communication between network services and the protocol layer.
§Features
- Asynchronous communication channels
- Bidirectional message passing
- Automatic protocol conversion
- Error propagation
- Resource cleanup on shutdown
- Stream-based I/O interface
§Example
use citadel_sdk::prelude::*;
use citadel_sdk::prefabs::shared::internal_service::InternalServerCommunicator;
use futures::Future;
async fn my_service(comm: InternalServerCommunicator) -> Result<(), NetworkError> {
// Service implementation
Ok(())
}
§Important Notes
- Services run in isolated contexts
- Communication is fully asynchronous
- Implements AsyncRead and AsyncWrite
- Automatic cleanup on drop
- Thread-safe message passing
§Related Components
CitadelClientServerConnection
: Connection event dataTargetLockedRemote
: Remote target interfaceNetworkError
: Error handlingSecBuffer
: Secure data handling