Download the PHP package mosamirzz/octane-grpc without Composer
On this page you can find all versions of the php package mosamirzz/octane-grpc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mosamirzz/octane-grpc
More information about mosamirzz/octane-grpc
Files in mosamirzz/octane-grpc
Package octane-grpc
Short Description Support gRPC server for laravel octane
License MIT
Homepage https://github.com/mosamirzz/octane-grpc
Informations about the package octane-grpc
Octane gRPC
Add support for gRPC server in laravel octane.
Installation
You can install the package via composer:
Usage
-
add the following at the end of your octane.php config file.
- create the routes file that will contains all the services that needs to be registered in the server.
and the content of the file will be like:
- add the following to composer.json:
then run this command
- run the server
requirements
openswoole
php extensionprotoc
protoc-gen-openswoole-grpc
plugin (to generate grpc serevr stubs)protoc-gen-php-grpc
plugin (to generate grpc client stubs)
-
download
openswoole
extension. - download
protoc
you can install the release you want from this page: Protobuf releases
- download the
protoc-gen-openswoole-grpc
you can install the release you want from this page: OpenSwoole plugin releases
-
download the
protoc-gen-php-grpc
- install protobuf compiler
server example
-
Create a
Proto/greeter.proto
- generate the code for the server
the command above will generate the following in your currenct directory
- write the service implementation
you will need to write the business login inside the generated service GreeterService.php
it will be like the following:
- now register the
GreeterService
in the gRPC server.
open routes/grpc.php
and add the following:
- run the gRPC server
client example
first of all you need to install grpc
extension
you can download it with
-
install
grpc/grpc
package - generate the php code from
greeter.proto
file for the client.
it will generate the files like:
- create a
client.php
file
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Mohamed Samir
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.