Skip to content

switon-php/rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Switon RPC Package

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages