Client

Usage

After setting up the gRPC you should be able to use the generated client as a Dependency Injection item:

php
<?php use App\Generated\Helloworld\GreeterClient; use App\Generated\Helloworld\HelloRequest; use Distantmagic\Resonance\Attribute\Singleton; use Distantmagic\Resonance\Feature; use Distantmagic\Resonance\WantsFeature; #[Singleton] #[WantsFeature(Feature::GrpcClient)] readonly class MyClass { public function __construct( private GreeterClient $greeterClient, ) { } public function doSomething(): void { $request = new HelloRequest(); $request->setName('World!'); $greeterClient->sayHello($request); } }
Edit on GitHub