youngones/lightspeed

Simple gRPC alternative for existing projects.

dev-master 2021-01-14 11:19 UTC

This package is not auto-updated.

Last update: 2024-04-19 03:48:42 UTC


README

logo-readme.png

Total Downloads Latest Stable Version License

Lightspeed is a lightweight communication solution for distributed Laravel applications inspired by gRPC. Without Protocol buffers.

What Lightspeed essentially does is run your normal routes, but streams the output over a TCP socket. The data is encoded as CBOR.

Installation

Via Composer

$ composer require youngones/lightspeed

Usage

Server side:

  1. Define the route you wish to request via Lightspeed:
// ./routes/web.php
Route::lightspeed('/test', 'TestController');
  1. Start the Lightspeed server:
$ php artisan lightspeed:server start

Client side:

// Create an instance of `\YoungOnes\Lightspeed\Client\Client`
$client = new \YoungOnes\Lightspeed\Client\Client();
// Create a request
$request = new \YoungOnes\Lightspeed\Requests\Request('127.0.0.1:9810', '/api/test', ['Authorization' => 'Bearer'])

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.