Skip to content

Laravel package for connecting to zerorpc service

License

Notifications You must be signed in to change notification settings

juwai/laravel-zerorpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-zerorpc

This package provides an easy way of connecting to zerorpc from a Laravel application. It uses the PHP zerorpc client.

Installation

  1. Add facade and providers to config/app.php

    'aliases' => [
        ...
        'ZeroRPC' => Juwai\LaravelZeroRPC\Facades\ZeroRPC::class,
    ],
    'providers' => [
        ...
        Juwai\LaravelZeroRPC\Providers\ZeroRPCContextProvider::class,
        Juwai\LaravelZeroRPC\Providers\ZeroRPCClientProvider::class,
    ],
  2. Publish config file:

    $ php artisan vendor:publish
  3. Add real service configuration to the published config file config/zerorpc.php.

Usage

$client = ZeroRPC::get('service_one', '1.0');
$response = $client->service_function($param1, $param2);

Connection monitor

If you installed Debugbar the RPC connection information shows on Debugbar panels.