duende-platform

Crates.ioduende-platform
lib.rsduende-platform
version0.2.0
created_at2026-01-06 14:09:02.142572+00
updated_at2026-01-13 12:16:43.305107+00
descriptionPlatform adapters for the Duende daemon framework (systemd, launchd, container, pepita, WOS)
homepage
repositoryhttps://github.com/paiml/duende
max_upload_size
id2025928
size181,094
Noah Gift (noahgift)

documentation

README

duende-platform

Platform adapters for the Duende daemon framework.

Crates.io Documentation License

Overview

Platform-specific implementations for spawning, signaling, and monitoring daemons across:

  • Linux (systemd): Service units with cgroup resource control
  • macOS (launchd): Property lists with keep-alive support
  • Container (Docker/OCI): Container runtime integration
  • pepita (MicroVM): Virtio-vsock communication
  • WOS (WebAssembly OS): Process scheduling with priority levels
  • Native (fallback): Direct process spawning

Usage

use duende_platform::{detect_platform, NativeAdapter, Platform, PlatformAdapter};

// Auto-detect platform
let platform = detect_platform();

// Create appropriate adapter
let adapter = NativeAdapter::new();

// Spawn daemon
let handle = adapter.spawn(my_daemon).await?;

// Signal daemon
adapter.signal(&handle, Signal::Term).await?;

Memory Locking (DT-007)

Prevents swap deadlock for daemons serving as swap devices:

use duende_platform::{lock_daemon_memory, is_memory_locked};

// Lock all current and future memory allocations
let result = lock_daemon_memory()?;
assert!(is_memory_locked());

Feature Flags

Feature Description
native (default) Native process adapter
linux systemd integration
macos launchd integration
container Docker/OCI support
pepita MicroVM support
wos WebAssembly OS support

License

MIT OR Apache-2.0

Commit count: 20

cargo fmt