Search by

restate / common

mark.sagikazar

Types the Restate PHP SDK packages share: serdes, targets, terminal errors and the JSON value mapping of handler payloads.

v0.1.0 2026-11-27 16:21 UTC

This package is auto-updated.

Last update: 2026-11-27 22:06:13 UTC


README

The types the Restate PHP SDK packages share: Restate\Serde and Restate\JsonSerde, Restate\Target, Restate\TerminalError, the Restate\Exception marker interface, and the JSON value mapping that turns handler payloads into DTOs and enums and back (Restate\JsonValueMapper, Restate\Reflection\HandlerSerdes). Handlers (restate/sdk) and the ingress client (restate/ingress) use the same classes, so a Target or a TerminalError means the same thing on both sides of a call.

Note

A community-maintained SDK: not an official Restate SDK, and not supported by Restate.

You rarely require this package yourself: every other restate/* package requires it, at the same version. Class names do not depend on the package: Restate\Target is Restate\Target whichever package brought it.

Installation

composer require restate/common

Usage

use Restate\Target;
use Restate\TerminalError;

$target = Target::object('Counter', 'alice', 'add')->scoped('tenant-1');

// Thrown from a handler: Restate does not retry it, and the caller receives it.
throw new TerminalError('Unknown product', 404, ['product' => 'book']);

Requirements

  • PHP 8.4, 8.5 or 8.6
  • No PHP extension besides ext-json; the Restate extension is not needed

Documentation

See the documentation, and Package Split for what each package contains.

This repository is a read-only subtree split of restate-php/restate. Report issues and send pull requests there.

License

MIT; see LICENSE.