Skip to content

Commit d1bafca

Browse files
committed
Fixed python layout.
1 parent e6b9e4c commit d1bafca

File tree

16 files changed

+209
-227
lines changed

16 files changed

+209
-227
lines changed

python/natsrpy/_natsrpy_rs/js/__init__.pyi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
from .managers.kv import KVManager
2-
from .managers.streams import StreamsManager
1+
from .managers import KVManager, StreamsManager
32

43
class JetStream:
54
async def publish(
65
self,
76
subject: str,
8-
payload: bytes,
7+
payload: str | bytes | bytearray | memoryview,
98
*,
109
headers: dict[str, str] | None = None,
1110
reply: str | None = None,
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
from datetime import timedelta
2+
3+
class DeliverPolicy:
4+
ALL: DeliverPolicy
5+
LAST: DeliverPolicy
6+
NEW: DeliverPolicy
7+
BY_START_SEQUENCE: DeliverPolicy
8+
BY_START_TIME: DeliverPolicy
9+
LAST_PER_SUBJECT: DeliverPolicy
10+
11+
class AckPolicy:
12+
EXPLICIT: AckPolicy
13+
NONE: AckPolicy
14+
ALL: AckPolicy
15+
16+
class ReplayPolicy:
17+
INSTANT: ReplayPolicy
18+
ORIGINAL: ReplayPolicy
19+
20+
class PriorityPolicy:
21+
NONE: PriorityPolicy
22+
OVERFLOW: PriorityPolicy
23+
PINNED_CLIENT: PriorityPolicy
24+
PRIORITIZED: PriorityPolicy
25+
26+
class PullConsumerConfig:
27+
durable_name: str | None
28+
name: str | None
29+
description: str | None
30+
deliver_policy: DeliverPolicy
31+
delivery_start_sequence: int | None
32+
delivery_start_time: int | None
33+
ack_policy: AckPolicy
34+
ack_wait: timedelta
35+
max_deliver: int
36+
filter_subject: str
37+
filter_subjects: list[str]
38+
replay_policy: ReplayPolicy
39+
rate_limit: int
40+
sample_frequency: int
41+
max_waiting: int
42+
max_ack_pending: int
43+
headers_only: bool
44+
max_batch: int
45+
max_bytes: int
46+
max_expires: timedelta
47+
inactive_threshold: timedelta
48+
num_replicas: int
49+
memory_storage: bool
50+
metadata: dict[str, str]
51+
backoff: list[timedelta]
52+
priority_policy: PriorityPolicy
53+
priority_groups: list[str]
54+
pause_until: int | None
55+
56+
def __init__(
57+
self,
58+
durable_name: str | None = None,
59+
name: str | None = None,
60+
description: str | None = None,
61+
deliver_policy: DeliverPolicy | None = None,
62+
delivery_start_sequence: int | None = None,
63+
delivery_start_time: int | None = None,
64+
ack_policy: AckPolicy | None = None,
65+
ack_wait: timedelta | None = None,
66+
max_deliver: int | None = None,
67+
filter_subject: str | None = None,
68+
filter_subjects: list[str] | None = None,
69+
replay_policy: ReplayPolicy | None = None,
70+
rate_limit: int | None = None,
71+
sample_frequency: int | None = None,
72+
max_waiting: int | None = None,
73+
max_ack_pending: int | None = None,
74+
headers_only: bool | None = None,
75+
max_batch: int | None = None,
76+
max_bytes: int | None = None,
77+
max_expires: timedelta | None = None,
78+
inactive_threshold: timedelta | None = None,
79+
num_replicas: int | None = None,
80+
memory_storage: bool | None = None,
81+
metadata: dict[str, str] | None = None,
82+
backoff: list[timedelta] | None = None,
83+
priority_policy: PriorityPolicy | None = None,
84+
priority_groups: list[str] | None = None,
85+
pause_until: int | None = None,
86+
) -> None: ...
87+
88+
class PushConsumerConfig:
89+
deliver_subject: str
90+
durable_name: str | None
91+
name: str | None
92+
description: str | None
93+
deliver_group: str | None
94+
deliver_policy: DeliverPolicy
95+
delivery_start_sequence: int | None
96+
delivery_start_time: int | None
97+
ack_policy: AckPolicy
98+
ack_wait: timedelta
99+
max_deliver: int
100+
filter_subject: str
101+
filter_subjects: list[str]
102+
replay_policy: ReplayPolicy
103+
rate_limit: int
104+
sample_frequency: int
105+
max_waiting: int
106+
max_ack_pending: int
107+
headers_only: bool
108+
flow_control: bool
109+
idle_heartbeat: timedelta
110+
num_replicas: int
111+
memory_storage: bool
112+
metadata: dict[str, str]
113+
backoff: list[timedelta]
114+
inactive_threshold: timedelta
115+
pause_until: int | None
116+
117+
def __init__(
118+
self,
119+
deliver_subject: str,
120+
durable_name: str | None = None,
121+
name: str | None = None,
122+
description: str | None = None,
123+
deliver_group: str | None = None,
124+
deliver_policy: DeliverPolicy | None = None,
125+
delivery_start_sequence: int | None = None,
126+
delivery_start_time: int | None = None,
127+
ack_policy: AckPolicy | None = None,
128+
ack_wait: timedelta | None = None,
129+
max_deliver: int | None = None,
130+
filter_subject: str | None = None,
131+
filter_subjects: list[str] | None = None,
132+
replay_policy: ReplayPolicy | None = None,
133+
rate_limit: int | None = None,
134+
sample_frequency: int | None = None,
135+
max_waiting: int | None = None,
136+
max_ack_pending: int | None = None,
137+
headers_only: bool | None = None,
138+
flow_control: bool | None = None,
139+
idle_heartbeat: timedelta | None = None,
140+
num_replicas: int | None = None,
141+
memory_storage: bool | None = None,
142+
metadata: dict[str, str] | None = None,
143+
backoff: list[timedelta] | None = None,
144+
inactive_threshold: timedelta | None = None,
145+
pause_until: int | None = None,
146+
) -> None: ...
147+
148+
class PushConsumer: ...
149+
class PullConsumer: ...

python/natsrpy/_natsrpy_rs/js/consumers/__init__.pyi

Lines changed: 0 additions & 19 deletions
This file was deleted.

python/natsrpy/_natsrpy_rs/js/consumers/common.pyi

Lines changed: 0 additions & 22 deletions
This file was deleted.

python/natsrpy/_natsrpy_rs/js/consumers/pull.pyi

Lines changed: 0 additions & 72 deletions
This file was deleted.

python/natsrpy/_natsrpy_rs/js/consumers/push.pyi

Lines changed: 0 additions & 69 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from typing import overload
2+
3+
from .consumers import (
4+
PullConsumer,
5+
PullConsumerConfig,
6+
PushConsumer,
7+
PushConsumerConfig,
8+
)
9+
from .kv import KeyValue, KVConfig
10+
from .stream import Stream, StreamConfig
11+
12+
class StreamsManager:
13+
async def create(self, config: StreamConfig) -> Stream: ...
14+
async def create_or_update(self, config: StreamConfig) -> Stream: ...
15+
async def get(self, bucket: str) -> Stream: ...
16+
async def delete(self, bucket: str) -> None: ...
17+
async def update(self, config: StreamConfig) -> Stream: ...
18+
19+
class KVManager:
20+
async def create(self, config: KVConfig) -> KeyValue: ...
21+
async def create_or_update(self, config: KVConfig) -> KeyValue: ...
22+
async def get(self, bucket: str) -> KeyValue: ...
23+
async def delete(self, bucket: str) -> None: ...
24+
async def update(self, config: KVConfig) -> KeyValue: ...
25+
26+
class ConsumersManager:
27+
@overload
28+
async def create(self, config: PullConsumerConfig) -> PullConsumer: ...
29+
@overload
30+
async def create(self, config: PushConsumerConfig) -> PushConsumer: ...

python/natsrpy/_natsrpy_rs/js/managers/__init__.pyi

Whitespace-only changes.

python/natsrpy/_natsrpy_rs/js/managers/consumers.pyi

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)