Skip to content

serp demo

Oleksandr Geronime edited this page Jun 27, 2026 · 1 revision

serp-demo

serp-demo — standalone C++ examples demonstrating each SERP framework primitive.

Each demo is a single self-contained .cpp file and a minimal CMakeLists.txt. Ideal for learning one concept at a time without needing a full project setup.


Prerequisites

brew install OleksandrGeronime/serp/serp-dev   # macOS
# or: install the serp-dev .deb package on Ubuntu

Build

git clone https://github.com/OleksandrGeronime/serp-demo
cd serp-demo
./scripts/build.sh

Demos

Demo Binary What it demonstrates
method/ demo_method RPC methods: fire-and-forget, args-only, return values; async subscribe vs polling vs blocking wait
property/ demo_property Observable properties: owner updates, subscriber receives every change via connect()
notification/ demo_notification One-shot events: owner fires Notification, subscriber lambdas invoked
timer/ demo_timer Repeating timers: Timer::createstart() → fires every second → stop() on shutdown
watchdog/ demo_watchdog Watchdog timeout: service blocks past deadline → process intentionally aborts
command/ demo_command CommandProcessor queue: DemoCommandonExecute()onPostProcessing()
runtime_console/ demo_runtime_console Interactive REPL: call service methods by name from the terminal
client_stream/ demo_client_stream Client-streaming: caller opens write stream, pushes data, service aggregates and replies
server_stream/ demo_server_stream Server-streaming: service pushes integers every 500 ms, caller cancels after 5 received
component_test/ demo_test Component test: mock dependencies, drive lifecycle, assert results with GTest

Run a Demo

./scripts/run.sh method          # runs demo_method
./scripts/run.sh runtime_console # opens interactive REPL

Recommended Reading Order

For newcomers, work through the demos in this order:

  1. method — understand the basic call pattern
  2. property — observable state
  3. notification — events
  4. timer — scheduling
  5. command — async orchestration
  6. component_test — testing your services
  7. runtime_console — dynamic invocation
  8. watchdog, client_stream, server_stream — advanced patterns

Clone this wiki locally