Skip to content

Commit

Permalink
Merge branch 'main' of github.com:PasNA6713/Propan into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik committed Aug 3, 2023
2 parents 0f75cc0 + 2ef8cec commit 2591cdc
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/docs/en/getting_started/1_quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ $ propan run [projectname].app.serve:app --env=.env --reload

Enjoy your new development experience!

??? tip "Don't forget to stop test broker container"
??? tip "Don't forget to stop the test broker container"
```bash
docker container stop test-mq
```
2 changes: 1 addition & 1 deletion docs/docs/en/getting_started/5_dependency/1_di-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Dependencies can also contain other dependencies. This works in a very predictab

## Use with regular functions

You can use the decorator `@apply_types` not only together with your `@broker.hanle', but also with the usual functions: both synchronous and asynchronous.
You can use the decorator `@apply_types` not only together with your `@broker.handle', but also with the usual functions: both synchronous and asynchronous.

=== "Sync"
```python hl_lines="3-4" linenums="1"
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/en/getting_started/7_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ second: you need to modify the broker with
# Testing

To test your app locally or in a CI pipeline, you want to reduce the number of external dependencies.
Runs a test suite more presently than instantiate a container with your Message Broker within the CI pipeline.
This allows running a test suite more quickly than when a container with your Message Broker needs to be instantiated within the CI pipeline.

Also, the absence of dependencies helps to avoid tests failure, based on an error in transmitting data to the broker, or accessing broker too early (when the container is not yet ready to receive connection).
Also, the absence of dependencies helps to avoid test failures that are due to errors in transmitting data to the broker, or accessing the broker too early (when the container is not yet ready to receive connections).

!!! note
To run asynchronous tests using **pytest**, you need to install extensions.
Expand All @@ -19,7 +19,7 @@ Also, the absence of dependencies helps to avoid tests failure, based on an erro

**Propan** allows you to modify the behavior of your broker so that it passes messages "in memory" without requiring you to discover external dependencies.

Let's image we have an application like so:
Let's imagine we have an application like so:

{% import 'getting_started/test/1.md' as includes with context %}
{{ includes }}
Expand All @@ -29,7 +29,7 @@ Then make an *RPC* request to check the result of the execution:
{! includes/getting_started/test/2.md !}

!!! note
Using test broker this way **RPC** is always able, even broker doesn't support it in regular mode.
When using the test broker this way, it is always possible to perform **RPC** requests even if the broker doesn't support it in regular mode.

## Using fixtures

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/en/getting_started/8_logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ from propan.annotations import Logger

broker = RabbitBroker()

@broker.hanle("test")
@broker.handle("test")
async def func(logger: Logger):
logger.info("message received")
```
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/ru/getting_started/4_broker/2_routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def base_handler(body: str):

## Обработка ошибок

Однако, все брокеры, поддерживающие механизм подтверждения получения сообщений, имеют в методе `@broker.hanle` флаг `retry`, который отвечает за логику обработки ошибок.
Однако, все брокеры, поддерживающие механизм подтверждения получения сообщений, имеют в методе `@broker.handle` флаг `retry`, который отвечает за логику обработки ошибок.

По умолчанию этот флаг имеет значение `False`, который говорит о том, что если в ходе обработки сообщения возникла ошибка, оно все равно будет извлечено из очереди.

Expand Down Expand Up @@ -65,4 +65,4 @@ async def base_handler(body: str):
Впоследствии эта логика будет переработана.

!!! tip
Для более сложных вариантов обработки ошибок вы можете использовать [tenacity](https://tenacity.readthedocs.io/en/latest/){.external-link target="_blank"}
Для более сложных вариантов обработки ошибок вы можете использовать [tenacity](https://tenacity.readthedocs.io/en/latest/){.external-link target="_blank"}
2 changes: 1 addition & 1 deletion docs/docs/ru/getting_started/4_broker/3_type-casting.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Приведение типов

Первый аргумент функции, обрамленной в `@broker.hanle` - это расшифрованное тело входящего сообщения.
Первый аргумент функции, обрамленной в `@broker.handle` - это расшифрованное тело входящего сообщения.

Тело входящих сообщений в **Propan** может быть одним из трех типов:

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/ru/getting_started/5_dependency/1_di-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ broker = RabbitBroker(dependencies=[Depends(...)])

## Использование с обычными функциями

Вы можете использовать декоратор `@apply_types` не только вместе с вашими `@broker.hanle`'ми, но и с обычными функциями: как синхронными, так и асинхронными.
Вы можете использовать декоратор `@apply_types` не только вместе с вашими `@broker.handle`'ми, но и с обычными функциями: как синхронными, так и асинхронными.

=== "Sync"
```python hl_lines="3-4" linenums="1"
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/ru/getting_started/8_logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from propan.annotations import Logger

broker = RabbitBroker()

@broker.hanle("test")
@broker.handle("test")
async def func(logger: Logger):
logger.info("message received")
```
Expand Down

0 comments on commit 2591cdc

Please sign in to comment.