Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation into Brazilian Portuguese and corrections to docs in English #81

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions docs/en/grpc-application-runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ For example, let's take the `Pinger` service described in the [documentation](ht

### DTO and service interface generation

A detailed description of how to do this can be read https://roadrunner.dev/docs/plugins-grpc
A detailed description of how to do this can be read <https://roadrunner.dev/docs/plugins-grpc>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


### Create worker for gRPC

Create a handler file in your application directory, for example - `GrpcWorker.php`:
Create a handler file in your application directory, for example `GrpcWorker.php`:

```php
declare(strict_types=1);

use Yiisoft\Yii\Runner\RoadRunner\RoadRunnerGrpcApplicationRunner;

ini_set('display_errors', 'stderr');
Expand Down
3 changes: 3 additions & 0 deletions docs/pt-BR/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Documentação do Yii RoadRunner Runner

- [Executor de aplicativo gRPC para RoadRunner](grpc-application-runner.md)
57 changes: 57 additions & 0 deletions docs/pt-BR/grpc-application-runner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Executor de aplicativo gRPC para RoadRunner

Yii RoadRunner Runner suporta a execução de serviços [gRPC](https://grpc.io) através de `RoadRunnerGrpcApplicationRunner`.

> Aviso! Para suporte ao PHP 8.2 use a extensão `grpc` >= 1.56.0

## Uso geral

Por exemplo, vamos pegar o serviço `Pinger` descrito na [documentação](https://roadrunner.dev/docs/plugins-grpc)

### DTO e geração de interface de serviço

Uma descrição detalhada de como fazer isso pode ser lida em <https://roadrunner.dev/docs/plugins-grpc>

### Criar trabalhador para gRPC

Crie um arquivo handler no diretório do seu aplicativo, por exemplo `GrpcWorker.php`:

```php
use Yiisoft\Yii\Runner\RoadRunner\RoadRunnerGrpcApplicationRunner;

ini_set('display_errors', 'stderr');

require_once dirname(__DIR__) . '/vendor/autoload.php';

$application = new RoadRunnerGrpcApplicationRunner(
rootPath: __DIR__,
debug: true
);
$application->setServices([
PingerInterface::class => Pinger::class,
])
$application->run();
```

### Configurar RoadRunner

Adicione o arquivo handler criado na seção `command` do arquivo de configuração `.rr.yaml`

```yaml
version: '3'

server:
command: "php GrpcWorker.php"
```

ou para a seção `command` do plugin `grpc` se você suporta múltiplos handlers (por exemplo, `http` e `grpc`)

```yaml
version: '3'

grpc:
pool:
command: "php GrpcWorker.php"
```

> Aviso! Se você também estiver implementando o lado do cliente (para chamar a API RoadRunner do aplicativo PHP), você precisará adicionar manualmente o pacote `grpc/grpc` da versão correta ao seu compositor.json.