switon/rpc

Queue-based request-reply RPC for Switon Framework

Maintainers

Package info

github.com/switon-php/rpc

Documentation

pkg:composer/switon/rpc

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-05-09 23:36 UTC

This package is auto-updated.

Last update: 2026-05-10 03:17:53 UTC


README

Queue-based request-reply RPC for Switon Framework.

Installation

composer require switon/rpc

Requirements: PHP 8.3+

Quick Start

use Switon\Core\Attribute\Autowired;
use Switon\Rpc\RpcInterface;

class UserService
{
    #[Autowired] protected RpcInterface $rpc;

    public function profile(int $userId): array
    {
        return $this->rpc->call(UserProfileService::class . '::profile', [$userId], 3);
    }
}

class UserProfileService
{
    public function profile(int $userId): array
    {
        return ['id' => $userId, 'name' => 'mark'];
    }
}

Docs: https://docs.switon.dev/latest/rpc

License

MIT.