[][src]Crate ipc_orchestrator

Opinionated orchestrator for services which communicate via IPC and are not expected to exit It allows to start and control processes, handling all the necessary boilerplate:

  • Running within async runtime
  • Uses tokio::process::Command with predefined params to execute commands
  • Uses log with info+ levels to
  • Uses ipc-channel to establish communication from and to processes
use tokio::process::{Command};
use ipc_orchestrator::orchestrator;
// from within async runtime:
    let mut orchestrator = orchestrator().ipc(false);
    orchestrator.start("start", &mut Command::new("echo"));
    orchestrator.connect().await

Modules

message

Tailored message structure which provides ultra fast serialization/deserialization Tailored to be used with IpcSender / IpcReceiver

Macros

should_not_complete

Structs

Bridge

Communication channel for module name

IpcReceiver

Receiving end of a channel using serialized messages.

IpcSender

Sending end of a channel using serialized messages.

Orchestrator

Orchestrator which is in progress of starting up

Process

Constants

IPC_SERVER_ENV_VAR

Functions

connect_ipc_server

This is helper function for implementing child processes Child process will automatically connect to the IPC server passed in the env var "IPC_SERVER". This env var is injected by orchestrator. Execution blocks until connected

orchestrator

Create default orchestrator

Type Definitions

Channel

Channel for duplex communication via IPC

Receiver

IPC Receiver for Message

Sender

IPC Sender for Message