← Back to docs

PCP · pcp

PCP IPC — App Server Runner

Provides PcpServerRunner for Tier 1 apps to expose their PcpServer over Unix socket, and the daemon-side client for invoking capabilities.

pcp-ipcv0.1.0pcp
1.9K
Lines of Code
60
Tests
13
Files

Architecture

Provides PcpServerRunner for app side and the corresponding client for daemon side. Uses pcp-stream for the binary wire protocol.

Overview

pcp-ipc bridges Tier 1 Portal-native apps and the PCP daemon. Apps use PcpServerRunner to create a Unix socket server at /run/portal/pcp/{app_id}.sock that exposes their PcpServer implementation. The daemon (portal-pcpd) connects to these sockets as a client to invoke capabilities. The crate handles the binary protocol framing, request/response correlation, and event subscription delivery.

Key Types

PcpServerRunnerServer runner for Tier 1 apps — creates Unix socket at /run/portal/pcp/{app_id}.sock, accepts connections, dispatches requests to PcpServer implementation.

Data Flow

App creates PcpServerRunner → listens on /run/portal/pcp/{app_id}.sock → pcpd connects → invokes capabilities via binary protocol

Dependencies

Internal (2)

External (9)

tokio workspacetokio-util 0.7serde workspaceserde_json workspacepostcard workspacetracing workspacethiserror workspaceasync-trait workspacedashmap workspace

Depends on pcp-core (trait/types), pcp-stream (wire protocol). External: tokio (async runtime).