PHPackages                             folk/sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. folk/sdk

ActiveLibrary[Queues &amp; Workers](/categories/queues)

folk/sdk
========

Universal PHP SDK for Folk application server

v0.4.1(2w ago)0331↑227.8%5MITPHPPHP &gt;=8.2CI passing

Since May 10Pushed 1w agoCompare

[ Source](https://github.com/Folk-Project/folk-sdk)[ Packagist](https://packagist.org/packages/folk/sdk)[ Docs](https://github.com/Folk-Project/folk-sdk)[ RSS](/packages/folk-sdk/feed)WikiDiscussions develop Synced 1w ago

READMEChangelogDependencies (8)Versions (23)Used By (5)

folk-sdk
========

[](#folk-sdk)

PHP SDK for Folk -- worker dispatch loop, HTTP handler, and request/response types.

**Version:** 0.2.0

Installation
------------

[](#installation)

```
composer require folk/sdk
```

Requires the `folk.so` PHP extension (built by folk-ext).

WorkerLoop
----------

[](#workerloop)

`WorkerLoop` is the PHP-side dispatch loop. It auto-detects the dispatch mode:

ModeHow it worksSerialization**Direct** (preferred)Rust calls PHP handler via `call_user_function` with zval arraysNone -- zero-copy**Extension**folk.so extension bridges Rust and PHPMinimal**Pipe** (legacy)stdin/stdout msgpack-RPCFull encode/decode### Direct dispatch (zero-copy)

[](#direct-dispatch-zero-copy)

When running inside `folk.so`, Rust passes request data as native PHP arrays (zvals) directly to the handler function. No JSON or msgpack encode/decode is needed. This is the fastest path.

Quick start
-----------

[](#quick-start)

```
