diff --git a/composer.json b/composer.json index d7bcb0d..2619a1a 100644 --- a/composer.json +++ b/composer.json @@ -55,9 +55,9 @@ "options": { "symlink": true, "versions": { - "thesis/grpc-client": "0.1.x-dev", - "thesis/grpc-protocol": "0.1.x-dev", - "thesis/grpc-server": "0.1.x-dev" + "thesis/grpc-client": "0.2.x-dev", + "thesis/grpc-protocol": "0.2.x-dev", + "thesis/grpc-server": "0.2.x-dev" } } } diff --git a/packages/client/composer.json b/packages/client/composer.json index 8c932a2..7fa4862 100644 --- a/packages/client/composer.json +++ b/packages/client/composer.json @@ -24,7 +24,7 @@ "amphp/http-client": "^5.3", "amphp/socket": "^2.3", "league/uri": "^7.8", - "thesis/grpc-protocol": "^0.1.5" + "thesis/grpc-protocol": "^0.2" }, "autoload": { "psr-4": { diff --git a/packages/client/src/Client/Internal/Http2/StreamFactory.php b/packages/client/src/Client/Internal/Http2/StreamFactory.php index 1b4d9df..7f9a465 100644 --- a/packages/client/src/Client/Internal/Http2/StreamFactory.php +++ b/packages/client/src/Client/Internal/Http2/StreamFactory.php @@ -95,7 +95,7 @@ public function create( return new ConcurrentClientStream( responseFuture: $response, send: $send, - decode: fn(Response $response) => $this->codec->decode($response->getBody(), $invoke->type, $cancellation), + decode: fn(Response $response) => $this->codec->decode($response->getBody(), $invoke->output, $cancellation), errors: $this->errors, complete: $deferred->getFuture(), ); diff --git a/packages/client/src/Client/Invoke.php b/packages/client/src/Client/Invoke.php index 1a7493d..7dc4042 100644 --- a/packages/client/src/Client/Invoke.php +++ b/packages/client/src/Client/Invoke.php @@ -4,6 +4,8 @@ namespace Thesis\Grpc\Client; +use Thesis\Grpc\RpcType; + /** * @api * @template-covariant In of object = object @@ -13,10 +15,11 @@ { /** * @param non-empty-string $method - * @param class-string $type + * @param class-string $output */ public function __construct( public string $method, - public string $type, + public string $output, + public RpcType $type, ) {} } diff --git a/packages/server/src/Server/RpcType.php b/packages/grpc/src/RpcType.php similarity index 84% rename from packages/server/src/Server/RpcType.php rename to packages/grpc/src/RpcType.php index 48b80f5..9dd42c5 100644 --- a/packages/server/src/Server/RpcType.php +++ b/packages/grpc/src/RpcType.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Thesis\Grpc\Server; +namespace Thesis\Grpc; /** * @api diff --git a/packages/server/composer.json b/packages/server/composer.json index fec1c4e..a314145 100644 --- a/packages/server/composer.json +++ b/packages/server/composer.json @@ -24,7 +24,7 @@ "amphp/socket": "^2.3", "amphp/sync": "^2.3", "psr/log": "^3.0", - "thesis/grpc-protocol": "^0.1.5" + "thesis/grpc-protocol": "^0.2" }, "autoload": { "psr-4": { diff --git a/packages/server/src/Server/Rpc.php b/packages/server/src/Server/Rpc.php index ecd79d8..c98f74b 100644 --- a/packages/server/src/Server/Rpc.php +++ b/packages/server/src/Server/Rpc.php @@ -4,6 +4,8 @@ namespace Thesis\Grpc\Server; +use Thesis\Grpc\RpcType; + /** * @api */ diff --git a/packages/server/src/Server/StreamInfo.php b/packages/server/src/Server/StreamInfo.php index b673631..2c4c5ca 100644 --- a/packages/server/src/Server/StreamInfo.php +++ b/packages/server/src/Server/StreamInfo.php @@ -4,6 +4,8 @@ namespace Thesis\Grpc\Server; +use Thesis\Grpc\RpcType; + /** * @api */ diff --git a/tests/Internal/Http2/UriFactoryTest.php b/tests/Internal/Http2/UriFactoryTest.php index 7fc5ca4..84ff91c 100644 --- a/tests/Internal/Http2/UriFactoryTest.php +++ b/tests/Internal/Http2/UriFactoryTest.php @@ -11,6 +11,7 @@ use Thesis\Grpc\Client\Internal\Http2\UriFactory; use Thesis\Grpc\Client\Internal\HttpScheme; use Thesis\Grpc\Client\Invoke; +use Thesis\Grpc\RpcType; #[CoversClass(UriFactory::class)] final class UriFactoryTest extends TestCase @@ -51,7 +52,7 @@ public function testCreate( string $uri, ): void { $factory = new UriFactory(HttpScheme::from($scheme)); - $invoke = new Invoke($method, \stdClass::class); + $invoke = new Invoke($method, \stdClass::class, RpcType::Unary); self::assertSame($uri, $factory->create(new Address($address), $invoke)); } diff --git a/tests/NotImplementedTest.php b/tests/NotImplementedTest.php index 5758a62..a25b81d 100644 --- a/tests/NotImplementedTest.php +++ b/tests/NotImplementedTest.php @@ -45,7 +45,7 @@ public function testEmptyMethod(): void $client = new Client\Builder()->build(); $this->expectExceptionMessage('A grpc error with status code "UNIMPLEMENTED" and message "Malformed method name: /" occurred'); - $client->invoke(new EchoRequest(), new Invoke('/', EchoResponse::class)); + $client->invoke(new EchoRequest(), new Invoke('/', EchoResponse::class, RpcType::Unary)); } public function testServiceNotImplemented(): void @@ -53,7 +53,7 @@ public function testServiceNotImplemented(): void $client = new Client\Builder()->build(); $this->expectExceptionMessage('A grpc error with status code "UNIMPLEMENTED" and message "Unknown service echos.api.v2.EchoService" occurred'); - $client->invoke(new EchoRequest(), new Invoke('/echos.api.v2.EchoService/Echo', EchoResponse::class)); + $client->invoke(new EchoRequest(), new Invoke('/echos.api.v2.EchoService/Echo', EchoResponse::class, RpcType::Unary)); } public function testMethodNotImplemented(): void @@ -61,6 +61,6 @@ public function testMethodNotImplemented(): void $client = new Client\Builder()->build(); $this->expectExceptionMessage('A grpc error with status code "UNIMPLEMENTED" and message "Unknown method Ping for service echos.api.v1.EchoService" occurred'); - $client->invoke(new EchoRequest(), new Invoke('/echos.api.v1.EchoService/Ping', EchoResponse::class)); + $client->invoke(new EchoRequest(), new Invoke('/echos.api.v1.EchoService/Ping', EchoResponse::class, RpcType::Unary)); } } diff --git a/tests/genproto/Chat/Api/V1/Message.php b/tests/genproto/Chat/Api/V1/Message.php index 4420c94..daac228 100644 --- a/tests/genproto/Chat/Api/V1/Message.php +++ b/tests/genproto/Chat/Api/V1/Message.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/chat_v1.proto */ diff --git a/tests/genproto/Chat/Api/V1/MessengerServiceClient.php b/tests/genproto/Chat/Api/V1/MessengerServiceClient.php index 5ae62af..a706240 100644 --- a/tests/genproto/Chat/Api/V1/MessengerServiceClient.php +++ b/tests/genproto/Chat/Api/V1/MessengerServiceClient.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/chat_v1.proto */ @@ -14,6 +14,7 @@ use Amp\Cancellation; use Amp\NullCancellation; +use Thesis\Grpc; use Thesis\Grpc\Client; use Thesis\Grpc\Metadata; @@ -36,7 +37,8 @@ public function chat( /** @var Client\Invoke<\Chat\Api\V1\Message, \Chat\Api\V1\Message> $invoke */ $invoke = new Client\Invoke( method: '/chat.api.v1.MessengerService/Chat', - type: \Chat\Api\V1\Message::class, + output: \Chat\Api\V1\Message::class, + type: Grpc\RpcType::BidirectionalStream, ); $stream = $this->client->createStream( diff --git a/tests/genproto/Chat/Api/V1/MessengerServiceServer.php b/tests/genproto/Chat/Api/V1/MessengerServiceServer.php index 000b53a..938ffc0 100644 --- a/tests/genproto/Chat/Api/V1/MessengerServiceServer.php +++ b/tests/genproto/Chat/Api/V1/MessengerServiceServer.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/chat_v1.proto */ diff --git a/tests/genproto/Chat/Api/V1/MessengerServiceServerRegistry.php b/tests/genproto/Chat/Api/V1/MessengerServiceServerRegistry.php index 3bed1a0..78fc775 100644 --- a/tests/genproto/Chat/Api/V1/MessengerServiceServerRegistry.php +++ b/tests/genproto/Chat/Api/V1/MessengerServiceServerRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/chat_v1.proto */ @@ -13,6 +13,7 @@ namespace Chat\Api\V1; use Override; +use Thesis\Grpc; use Thesis\Grpc\Server; /** @@ -29,9 +30,9 @@ public function services(): iterable { yield new Server\Service('chat.api.v1.MessengerService', [ new Server\Rpc( - new Server\Handle('Chat', \Chat\Api\V1\Message::class), - new Server\BidirectionalStreamHandler($this->server->chat(...)), - Server\RpcType::BidirectionalStream, + handle: new Server\Handle('Chat', \Chat\Api\V1\Message::class), + handler: new Server\BidirectionalStreamHandler($this->server->chat(...)), + type: Grpc\RpcType::BidirectionalStream, ), ]); } diff --git a/tests/genproto/Chat/Api/V1/TestsProtosChatV1DescriptorRegistry.php b/tests/genproto/Chat/Api/V1/TestsProtosChatV1DescriptorRegistry.php index bb566fa..9e7cfd2 100644 --- a/tests/genproto/Chat/Api/V1/TestsProtosChatV1DescriptorRegistry.php +++ b/tests/genproto/Chat/Api/V1/TestsProtosChatV1DescriptorRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/chat_v1.proto */ diff --git a/tests/genproto/Chat/Api/V1/autoload.metadata.php b/tests/genproto/Chat/Api/V1/autoload.metadata.php index d2f5e97..54e4295 100644 --- a/tests/genproto/Chat/Api/V1/autoload.metadata.php +++ b/tests/genproto/Chat/Api/V1/autoload.metadata.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 */ diff --git a/tests/genproto/Echos/Api/V1/EchoRequest.php b/tests/genproto/Echos/Api/V1/EchoRequest.php index 571d14f..637fbbb 100644 --- a/tests/genproto/Echos/Api/V1/EchoRequest.php +++ b/tests/genproto/Echos/Api/V1/EchoRequest.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/EchoResponse.php b/tests/genproto/Echos/Api/V1/EchoResponse.php index f25fc76..8e076ba 100644 --- a/tests/genproto/Echos/Api/V1/EchoResponse.php +++ b/tests/genproto/Echos/Api/V1/EchoResponse.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/EchoServiceClient.php b/tests/genproto/Echos/Api/V1/EchoServiceClient.php index 29de9c1..700d41d 100644 --- a/tests/genproto/Echos/Api/V1/EchoServiceClient.php +++ b/tests/genproto/Echos/Api/V1/EchoServiceClient.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ @@ -14,6 +14,7 @@ use Amp\Cancellation; use Amp\NullCancellation; +use Thesis\Grpc; use Thesis\Grpc\Client; use Thesis\Grpc\Exception\ClientStreamIsClosed; use Thesis\Grpc\InvokeError; @@ -40,7 +41,8 @@ public function echo( /** @var Client\Invoke<\Echos\Api\V1\EchoRequest, \Echos\Api\V1\EchoResponse> $invoke */ $invoke = new Client\Invoke( method: '/echos.api.v1.EchoService/Echo', - type: \Echos\Api\V1\EchoResponse::class, + output: \Echos\Api\V1\EchoResponse::class, + type: Grpc\RpcType::Unary, ); return $this->client->invoke( diff --git a/tests/genproto/Echos/Api/V1/EchoServiceServer.php b/tests/genproto/Echos/Api/V1/EchoServiceServer.php index 4004832..d731c7c 100644 --- a/tests/genproto/Echos/Api/V1/EchoServiceServer.php +++ b/tests/genproto/Echos/Api/V1/EchoServiceServer.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php b/tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php index c55aac2..ed5ceab 100644 --- a/tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php +++ b/tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ @@ -13,6 +13,7 @@ namespace Echos\Api\V1; use Override; +use Thesis\Grpc; use Thesis\Grpc\Server; /** @@ -29,9 +30,9 @@ public function services(): iterable { yield new Server\Service('echos.api.v1.EchoService', [ new Server\Rpc( - new Server\Handle('Echo', \Echos\Api\V1\EchoRequest::class), - new Server\UnaryHandler($this->server->echo(...)), - Server\RpcType::Unary, + handle: new Server\Handle('Echo', \Echos\Api\V1\EchoRequest::class), + handler: new Server\UnaryHandler($this->server->echo(...)), + type: Grpc\RpcType::Unary, ), ]); } diff --git a/tests/genproto/Echos/Api/V1/TestsProtosEchoV1DescriptorRegistry.php b/tests/genproto/Echos/Api/V1/TestsProtosEchoV1DescriptorRegistry.php index 5a60d83..6a99d74 100644 --- a/tests/genproto/Echos/Api/V1/TestsProtosEchoV1DescriptorRegistry.php +++ b/tests/genproto/Echos/Api/V1/TestsProtosEchoV1DescriptorRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/autoload.metadata.php b/tests/genproto/Echos/Api/V1/autoload.metadata.php index ee2e6c0..4d98e44 100644 --- a/tests/genproto/Echos/Api/V1/autoload.metadata.php +++ b/tests/genproto/Echos/Api/V1/autoload.metadata.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 */ diff --git a/tests/genproto/File/Api/V1/Chunk.php b/tests/genproto/File/Api/V1/Chunk.php index 25dda34..6279759 100644 --- a/tests/genproto/File/Api/V1/Chunk.php +++ b/tests/genproto/File/Api/V1/Chunk.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/file_v1.proto */ diff --git a/tests/genproto/File/Api/V1/FileInfo.php b/tests/genproto/File/Api/V1/FileInfo.php index 6385557..6ecdfa8 100644 --- a/tests/genproto/File/Api/V1/FileInfo.php +++ b/tests/genproto/File/Api/V1/FileInfo.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/file_v1.proto */ diff --git a/tests/genproto/File/Api/V1/FileServiceClient.php b/tests/genproto/File/Api/V1/FileServiceClient.php index 8d46d98..4efd3cf 100644 --- a/tests/genproto/File/Api/V1/FileServiceClient.php +++ b/tests/genproto/File/Api/V1/FileServiceClient.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/file_v1.proto */ @@ -14,6 +14,7 @@ use Amp\Cancellation; use Amp\NullCancellation; +use Thesis\Grpc; use Thesis\Grpc\Client; use Thesis\Grpc\Metadata; @@ -36,7 +37,8 @@ public function upload( /** @var Client\Invoke<\File\Api\V1\Chunk, \File\Api\V1\FileInfo> $invoke */ $invoke = new Client\Invoke( method: '/file.api.v1.FileService/Upload', - type: \File\Api\V1\FileInfo::class, + output: \File\Api\V1\FileInfo::class, + type: Grpc\RpcType::ClientStream, ); $stream = $this->client->createStream( diff --git a/tests/genproto/File/Api/V1/FileServiceServer.php b/tests/genproto/File/Api/V1/FileServiceServer.php index 4c6e0d2..e80285e 100644 --- a/tests/genproto/File/Api/V1/FileServiceServer.php +++ b/tests/genproto/File/Api/V1/FileServiceServer.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/file_v1.proto */ diff --git a/tests/genproto/File/Api/V1/FileServiceServerRegistry.php b/tests/genproto/File/Api/V1/FileServiceServerRegistry.php index c816b9d..3c1216a 100644 --- a/tests/genproto/File/Api/V1/FileServiceServerRegistry.php +++ b/tests/genproto/File/Api/V1/FileServiceServerRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/file_v1.proto */ @@ -13,6 +13,7 @@ namespace File\Api\V1; use Override; +use Thesis\Grpc; use Thesis\Grpc\Server; /** @@ -29,9 +30,9 @@ public function services(): iterable { yield new Server\Service('file.api.v1.FileService', [ new Server\Rpc( - new Server\Handle('Upload', \File\Api\V1\Chunk::class), - new Server\ClientStreamHandler($this->server->upload(...)), - Server\RpcType::ClientStream, + handle: new Server\Handle('Upload', \File\Api\V1\Chunk::class), + handler: new Server\ClientStreamHandler($this->server->upload(...)), + type: Grpc\RpcType::ClientStream, ), ]); } diff --git a/tests/genproto/File/Api/V1/TestsProtosFileV1DescriptorRegistry.php b/tests/genproto/File/Api/V1/TestsProtosFileV1DescriptorRegistry.php index 4d2dd65..b93aa24 100644 --- a/tests/genproto/File/Api/V1/TestsProtosFileV1DescriptorRegistry.php +++ b/tests/genproto/File/Api/V1/TestsProtosFileV1DescriptorRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/file_v1.proto */ diff --git a/tests/genproto/File/Api/V1/autoload.metadata.php b/tests/genproto/File/Api/V1/autoload.metadata.php index 541a955..9d5c37a 100644 --- a/tests/genproto/File/Api/V1/autoload.metadata.php +++ b/tests/genproto/File/Api/V1/autoload.metadata.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 */ diff --git a/tests/genproto/Topic/Api/V1/Event.php b/tests/genproto/Topic/Api/V1/Event.php index 78ba771..3c5b0a4 100644 --- a/tests/genproto/Topic/Api/V1/Event.php +++ b/tests/genproto/Topic/Api/V1/Event.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/topic_v1.proto */ diff --git a/tests/genproto/Topic/Api/V1/SubscribeRequest.php b/tests/genproto/Topic/Api/V1/SubscribeRequest.php index aff0917..d8bef44 100644 --- a/tests/genproto/Topic/Api/V1/SubscribeRequest.php +++ b/tests/genproto/Topic/Api/V1/SubscribeRequest.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/topic_v1.proto */ diff --git a/tests/genproto/Topic/Api/V1/TestsProtosTopicV1DescriptorRegistry.php b/tests/genproto/Topic/Api/V1/TestsProtosTopicV1DescriptorRegistry.php index c3f58af..91609a1 100644 --- a/tests/genproto/Topic/Api/V1/TestsProtosTopicV1DescriptorRegistry.php +++ b/tests/genproto/Topic/Api/V1/TestsProtosTopicV1DescriptorRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/topic_v1.proto */ diff --git a/tests/genproto/Topic/Api/V1/TopicServiceClient.php b/tests/genproto/Topic/Api/V1/TopicServiceClient.php index 895755d..e2a538e 100644 --- a/tests/genproto/Topic/Api/V1/TopicServiceClient.php +++ b/tests/genproto/Topic/Api/V1/TopicServiceClient.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/topic_v1.proto */ @@ -14,6 +14,7 @@ use Amp\Cancellation; use Amp\NullCancellation; +use Thesis\Grpc; use Thesis\Grpc\Client; use Thesis\Grpc\Metadata; @@ -37,7 +38,8 @@ public function subscribe( /** @var Client\Invoke<\Topic\Api\V1\SubscribeRequest, \Topic\Api\V1\Event> $invoke */ $invoke = new Client\Invoke( method: '/topic.api.v1.TopicService/Subscribe', - type: \Topic\Api\V1\Event::class, + output: \Topic\Api\V1\Event::class, + type: Grpc\RpcType::ServerStream, ); $stream = $this->client->createStream( diff --git a/tests/genproto/Topic/Api/V1/TopicServiceServer.php b/tests/genproto/Topic/Api/V1/TopicServiceServer.php index 9fed33c..96e42e0 100644 --- a/tests/genproto/Topic/Api/V1/TopicServiceServer.php +++ b/tests/genproto/Topic/Api/V1/TopicServiceServer.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/topic_v1.proto */ diff --git a/tests/genproto/Topic/Api/V1/TopicServiceServerRegistry.php b/tests/genproto/Topic/Api/V1/TopicServiceServerRegistry.php index 7198a66..3826682 100644 --- a/tests/genproto/Topic/Api/V1/TopicServiceServerRegistry.php +++ b/tests/genproto/Topic/Api/V1/TopicServiceServerRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 * Source: tests/protos/topic_v1.proto */ @@ -13,6 +13,7 @@ namespace Topic\Api\V1; use Override; +use Thesis\Grpc; use Thesis\Grpc\Server; /** @@ -29,9 +30,9 @@ public function services(): iterable { yield new Server\Service('topic.api.v1.TopicService', [ new Server\Rpc( - new Server\Handle('Subscribe', \Topic\Api\V1\SubscribeRequest::class), - new Server\ServerStreamHandler($this->server->subscribe(...)), - Server\RpcType::ServerStream, + handle: new Server\Handle('Subscribe', \Topic\Api\V1\SubscribeRequest::class), + handler: new Server\ServerStreamHandler($this->server->subscribe(...)), + type: Grpc\RpcType::ServerStream, ), ]); } diff --git a/tests/genproto/Topic/Api/V1/autoload.metadata.php b/tests/genproto/Topic/Api/V1/autoload.metadata.php index 9c39487..53474ae 100644 --- a/tests/genproto/Topic/Api/V1/autoload.metadata.php +++ b/tests/genproto/Topic/Api/V1/autoload.metadata.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.1.24 + * thesis/protoc-plugin — v0.2.0 * protoc — v6.33.5 */