From e9be03d506bc03718c11f004919c5e6fa6a12447 Mon Sep 17 00:00:00 2001 From: Blax Software Date: Wed, 22 Jul 2026 10:22:37 +0200 Subject: [PATCH] docs(sfu): reflect shipped-in-package binary in BinaryManager + README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to shipping rust/dist/: the resolution-order docblock and the README "backend-hosted rooms" section said the binary is downloaded on first use — it's now committed in the package and resolved locally (download is the fallback). Co-Authored-By: Claude Opus 4.8 (1M context) --- README.md | 2 +- src/Media/Rust/BinaryManager.php | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 528478b..0828d5b 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ Mesh is fine for two browsers; for **hosted rooms** — server in the media path WEBRTC_MEDIA_ENGINE="Blax\WebRtc\Media\RustMediaEngine" ``` -That's the whole setup — it is **plug-and-play**. On first use the engine downloads the prebuilt, sha256-verified `blax-webrtc-sfu` static binary for your platform (the RoadRunner pattern) and spawns it detached, flock-guarded so concurrent workers race exactly one spawn. Explicit control when you want it: +That's the whole setup — it is **plug-and-play**. The prebuilt, sha256-verified `blax-webrtc-sfu` static binary is **shipped inside the package** (`rust/dist/`), so `composer require`/`update` alone gives you a working sidecar — no download step, no release to chase. The engine spawns it detached on first use, flock-guarded so concurrent workers race exactly one spawn. (For a platform not committed to `rust/dist/`, it falls back to downloading a sha256-verified release.) Explicit control when you want it: ```bash php artisan webrtc:install # pre-download the binary (deploy step) diff --git a/src/Media/Rust/BinaryManager.php b/src/Media/Rust/BinaryManager.php index a399fa6..50c7a44 100644 --- a/src/Media/Rust/BinaryManager.php +++ b/src/Media/Rust/BinaryManager.php @@ -5,15 +5,17 @@ declare(strict_types=1); namespace Blax\WebRtc\Media\Rust; /** - * Locates — and, plug-and-play, downloads — the prebuilt `blax-webrtc-sfu` - * static binary (the RoadRunner pattern: composer ships the PHP, the release - * ships the binary, this class marries them). + * Locates the prebuilt `blax-webrtc-sfu` static binary. Plug-and-play: the + * binary is SHIPPED inside the package (rust/dist/, committed), so a plain + * `composer require`/`update` gets a working sidecar with no download step — + * download is only a last-resort fallback for uncommitted platforms. * * Resolution order: * 1. an explicit `webrtc.sfu.binary` path, * 2. a local dev build under the package's rust/target/{release,debug}, - * 3. the installed download for this package version + platform, - * 4. (when auto_install) download from `webrtc.sfu.download_url`, verify the + * 3. the SHIPPED binary rust/dist/blax-webrtc-sfu- (committed), + * 4. a previously installed download for this package version + platform, + * 5. (when auto_install) download from `webrtc.sfu.download_url`, verify the * sha256 from `webrtc.sfu.checksum_url`, install atomically. */ class BinaryManager