Skip to content

Commit a6e3359

Browse files
Update documentation (#471)
Co-authored-by: gwaramadze <1044831+gwaramadze@users.noreply.github.com>
1 parent b808e4c commit a6e3359

File tree

3 files changed

+678
-177
lines changed

3 files changed

+678
-177
lines changed

docs/api-reference/application.md

Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class Application()
1111
```
1212

13-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L57)
13+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L61)
1414

1515
The main Application class.
1616

@@ -84,7 +84,7 @@ def __init__(broker_address: Optional[Union[str, ConnectionConfig]] = None,
8484
processing_guarantee: ProcessingGuarantee = "at-least-once")
8585
```
8686

87-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L95)
87+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L99)
8888

8989

9090
<br>
@@ -125,7 +125,7 @@ will be passed to `confluent_kafka.Consumer` as is.
125125
- `producer_extra_config`: A dictionary with additional options that
126126
will be passed to `confluent_kafka.Producer` as is.
127127
- `state_dir`: path to the application state directory.
128-
Default - `".state"`.
128+
Default - `"state"`.
129129
- `rocksdb_options`: RocksDB options.
130130
If `None`, the default options will be used.
131131
- `consumer_poll_timeout`: timeout for `RowConsumer.poll()`. Default - `1.0`s
@@ -196,7 +196,7 @@ def Quix(
196196
) -> Self
197197
```
198198

199-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L347)
199+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L353)
200200

201201
>***NOTE:*** DEPRECATED: use Application with `quix_sdk_token` argument instead.
202202

@@ -307,7 +307,7 @@ def topic(name: str,
307307
timestamp_extractor: Optional[TimestampExtractor] = None) -> Topic
308308
```
309309

310-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L488)
310+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L494)
311311

312312
Create a topic definition.
313313

@@ -388,7 +388,7 @@ topic = app.topic("input-topic", timestamp_extractor=custom_ts_extractor)
388388
def dataframe(topic: Topic) -> StreamingDataFrame
389389
```
390390

391-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L568)
391+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L574)
392392

393393
A simple helper method that generates a `StreamingDataFrame`, which is used
394394

@@ -438,7 +438,7 @@ to be used as an input topic.
438438
def stop(fail: bool = False)
439439
```
440440

441-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L607)
441+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L613)
442442

443443
Stop the internal poll loop and the message processing.
444444

@@ -465,7 +465,7 @@ to unhandled exception, and it shouldn't commit the current checkpoint.
465465
def get_producer() -> Producer
466466
```
467467

468-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L630)
468+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L636)
469469

470470
Create and return a pre-configured Producer instance.
471471
The Producer is initialized with params passed to Application.
@@ -482,7 +482,7 @@ instance each time, which is not optimized for repeated use in a streaming pipel
482482
```python
483483
from quixstreams import Application
484484

485-
app = Application.Quix(...)
485+
app = Application(...)
486486
topic = app.topic("input")
487487

488488
with app.get_producer() as producer:
@@ -500,7 +500,7 @@ with app.get_producer() as producer:
500500
def get_consumer(auto_commit_enable: bool = True) -> Consumer
501501
```
502502

503-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L660)
503+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L666)
504504

505505
Create and return a pre-configured Consumer instance.
506506
The Consumer is initialized with params passed to Application.
@@ -525,7 +525,7 @@ the consumer config when creating the app.
525525
```python
526526
from quixstreams import Application
527527

528-
app = Application.Quix(...)
528+
app = Application(...)
529529
topic = app.topic("input")
530530

531531
with app.get_consumer() as consumer:
@@ -549,7 +549,7 @@ with app.get_consumer() as consumer:
549549
def clear_state()
550550
```
551551

552-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L707)
552+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L713)
553553

554554
Clear the state of the application.
555555

@@ -563,7 +563,7 @@ Clear the state of the application.
563563
def run(dataframe: StreamingDataFrame)
564564
```
565565

566-
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L713)
566+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L719)
567567

568568
Start processing data from Kafka using provided `StreamingDataFrame`
569569

@@ -595,3 +595,52 @@ app.run(dataframe=df)
595595

596596
- `dataframe`: instance of `StreamingDataFrame`
597597

598+
<a id="quixstreams.app.ApplicationConfig"></a>
599+
600+
### ApplicationConfig
601+
602+
```python
603+
class ApplicationConfig(BaseSettings)
604+
```
605+
606+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L975)
607+
608+
Immutable object holding the application configuration
609+
610+
For details see :class:`quixstreams.Application`
611+
612+
<a id="quixstreams.app.ApplicationConfig.settings_customise_sources"></a>
613+
614+
<br><br>
615+
616+
#### ApplicationConfig.settings\_customise\_sources
617+
618+
```python
619+
@classmethod
620+
def settings_customise_sources(
621+
cls, settings_cls: Type[BaseSettings],
622+
init_settings: PydanticBaseSettingsSource,
623+
env_settings: PydanticBaseSettingsSource,
624+
dotenv_settings: PydanticBaseSettingsSource,
625+
file_secret_settings: PydanticBaseSettingsSource
626+
) -> Tuple[PydanticBaseSettingsSource, ...]
627+
```
628+
629+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1009)
630+
631+
Included to ignore reading/setting values from the environment
632+
633+
<a id="quixstreams.app.ApplicationConfig.copy"></a>
634+
635+
<br><br>
636+
637+
#### ApplicationConfig.copy
638+
639+
```python
640+
def copy(**kwargs) -> Self
641+
```
642+
643+
[[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/app.py#L1022)
644+
645+
Update the application config and return a copy
646+

0 commit comments

Comments
 (0)