Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion docs/docs/en/kafka/Subscriber/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ async def base_handler(
...
```


## Concurrent processing

There are two possible modes of concurrent message processing:

* With `auto_commit=False` and `max_workers` > 1, a handler processes all messages concurrently in a at-most-once semantic.
* With `auto_commit=True` and `max_workers` > 1, processing is concurrent between topic partitions and sequential within a partition to ensure reliable at-least-once processing. Maximum concurrency is achieved when total number of workers across all application instances running workers in the same consumer group is equal to the number of partitions in the topic. Increasing worker count beyond that will result in idle workers as not more than one consumer from a consumer group can be consuming from the same partition.
4 changes: 2 additions & 2 deletions faststream/_internal/cli/utils/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def set_log_level(level: int, app: "Application") -> None:

def _get_json_config(file: Path) -> dict[str, Any] | Any:
"""Parse json config file to dict."""
with file.open("r") as config_file:
with file.open("r", encoding="utf-8") as config_file:
return json.load(config_file)


Expand All @@ -102,7 +102,7 @@ def _get_yaml_config(file: Path) -> dict[str, Any] | Any:
typer.echo(INSTALL_YAML, err=True)
raise typer.Exit(1) from e

with file.open("r") as config_file:
with file.open("r", encoding="utf-8") as config_file:
return yaml.safe_load(config_file)


Expand Down
2 changes: 1 addition & 1 deletion faststream/specification/asyncapi/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def get_query_params(self) -> dict[str, bool]:
for i, j in parse_qs(urlparse(self.path).query).items()
}

def do_GET(self) -> None: # noqa: N802
def do_GET(self) -> None:
"""Serve a GET request."""
query_dict = self.get_query_params()

Expand Down
2 changes: 1 addition & 1 deletion tests/cli/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def factory(
file_path: Path = faststream_tmp_path / filename
cleaned_code = dedent(code).strip()

file_path.write_text(cleaned_code)
file_path.write_text(cleaned_code, encoding="utf-8")

try:
yield file_path
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/supervisors/test_watchfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_restart(mock: MagicMock, generate_template: GenerateTemplateFactory) ->
def touch_file(file: Path) -> None:
while True:
time.sleep(0.1)
file.write_text("hello")
file.write_text("hello", encoding="utf-8")


def exit(parent_id: int) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/mypy/nats.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from faststream.nats.message import NatsKvMessage, NatsObjMessage
from faststream.nats.opentelemetry import NatsTelemetryMiddleware
from faststream.nats.prometheus import NatsPrometheusMiddleware
from faststream.nats.schemas import PullSub, ObjWatch
from faststream.nats.schemas import ObjWatch, PullSub
from faststream.nats.subscriber.usecases import (
BatchPullStreamSubscriber,
ConcurrentCoreSubscriber,
Expand Down
192 changes: 104 additions & 88 deletions uv.lock

Large diffs are not rendered by default.

Loading