[−][src]Function portus::run
pub fn run<I, U>(
backend_builder: BackendBuilder<I>,
cfg: Config,
alg: U
) -> Result<!> where
I: Ipc,
U: CongAlg<I>,
Main execution loop of CCP for the static pipeline use case.
The run
method blocks 'forever'; it only returns in two cases:
- The IPC socket is closed.
- An invalid message is received.
Callers must construct a BackendBuilder
and a Config
.
Algorithm implementations should
- Initializes an ipc backendbuilder (depending on the datapath).
- Calls
run()
, orspawn()
passing theBackendBuilder b
and aConfig
with optional logger and command line argument structure. Run() or spawn() create arcobjects, which are passed into run_inner to build the backend, so spawn() can create a CCPHandle that references this boolean to kill the thread.