sentry-arroyo 2.20.10__tar.gz → 2.21.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sentry_arroyo-2.20.10/sentry_arroyo.egg-info → sentry_arroyo-2.21.0}/PKG-INFO +1 -1
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/backends/abstract.py +10 -33
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0/sentry_arroyo.egg-info}/PKG-INFO +1 -1
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/setup.py +1 -1
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/backends/test_kafka.py +9 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/LICENSE +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/MANIFEST.in +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/README.md +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/backends/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/backends/kafka/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/backends/kafka/commit.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/backends/kafka/configuration.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/backends/kafka/consumer.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/backends/local/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/backends/local/backend.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/backends/local/storages/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/backends/local/storages/abstract.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/backends/local/storages/memory.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/commit.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/dlq.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/errors.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/processor.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/abstract.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/batching.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/buffer.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/commit.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/filter.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/guard.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/healthcheck.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/noop.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/produce.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/reduce.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/run_task.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/run_task_in_threads.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/run_task_with_multiprocessing.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/unfold.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/py.typed +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/types.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/utils/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/utils/clock.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/utils/codecs.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/utils/concurrent.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/utils/logging.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/utils/metricDefs.json +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/utils/metric_defs.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/utils/metrics.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/utils/profiler.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/utils/retries.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/examples/transform_and_produce/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/examples/transform_and_produce/batched.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/examples/transform_and_produce/script.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/examples/transform_and_produce/simple.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/requirements.txt +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/sentry_arroyo.egg-info/SOURCES.txt +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/sentry_arroyo.egg-info/dependency_links.txt +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/sentry_arroyo.egg-info/not-zip-safe +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/sentry_arroyo.egg-info/requires.txt +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/sentry_arroyo.egg-info/top_level.txt +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/setup.cfg +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/backends/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/backends/mixins.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/backends/test_commit.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/backends/test_local.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_all.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_batching.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_buffer.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_commit.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_filter.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_guard.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_noop.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_produce.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_reduce.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_run_task.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_run_task_in_threads.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_run_task_with_multiprocessing.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/strategies/test_unfold.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/processing/test_processor.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/test_commit.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/test_dlq.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/test_kip848_e2e.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/test_types.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/utils/__init__.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/utils/test_concurrent.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/utils/test_metrics.py +0 -0
- {sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/tests/utils/test_retries.py +0 -0
|
@@ -4,16 +4,7 @@ import logging
|
|
|
4
4
|
import time
|
|
5
5
|
from abc import ABC, abstractmethod, abstractproperty
|
|
6
6
|
from concurrent.futures import Future
|
|
7
|
-
from typing import
|
|
8
|
-
Callable,
|
|
9
|
-
Generic,
|
|
10
|
-
Mapping,
|
|
11
|
-
Optional,
|
|
12
|
-
Protocol,
|
|
13
|
-
Sequence,
|
|
14
|
-
TypeVar,
|
|
15
|
-
Union,
|
|
16
|
-
)
|
|
7
|
+
from typing import Callable, Generic, Mapping, Optional, Sequence, TypeVar, Union
|
|
17
8
|
|
|
18
9
|
from arroyo.types import BrokerValue, Partition, Topic, TStrategyPayload
|
|
19
10
|
|
|
@@ -187,32 +178,11 @@ class Consumer(Generic[TStrategyPayload], ABC):
|
|
|
187
178
|
raise NotImplementedError
|
|
188
179
|
|
|
189
180
|
|
|
190
|
-
class ProducerFuture(Protocol, Generic[T]):
|
|
191
|
-
"""
|
|
192
|
-
An abstract interface for a kind of Future. Stdlib futures are too slow to
|
|
193
|
-
construct, so we use these.
|
|
194
|
-
"""
|
|
195
|
-
|
|
196
|
-
def done(self) -> bool:
|
|
197
|
-
...
|
|
198
|
-
|
|
199
|
-
def result(self, timeout: float | None = None) -> T:
|
|
200
|
-
"""
|
|
201
|
-
Return result or raise exception. May block, but does not have to.
|
|
202
|
-
"""
|
|
203
|
-
...
|
|
204
|
-
|
|
205
|
-
def set_result(self, result: T) -> None:
|
|
206
|
-
...
|
|
207
|
-
|
|
208
|
-
def set_exception(self, exception: Exception) -> None:
|
|
209
|
-
...
|
|
210
|
-
|
|
211
|
-
|
|
212
181
|
class SimpleProducerFuture(Generic[T]):
|
|
213
182
|
"""
|
|
214
183
|
A stub for concurrent.futures.Future that does not construct any Condition
|
|
215
|
-
variables, therefore is faster to construct.
|
|
184
|
+
variables, therefore is faster to construct. However, some methods are
|
|
185
|
+
missing, and result() in particular is not efficient with timeout > 0.
|
|
216
186
|
"""
|
|
217
187
|
|
|
218
188
|
def __init__(self) -> None:
|
|
@@ -232,6 +202,10 @@ class SimpleProducerFuture(Generic[T]):
|
|
|
232
202
|
# only in tests at most. It is only here for the sake of implementing
|
|
233
203
|
# the contract. If you really need result with timeout>0, you should
|
|
234
204
|
# use the stdlib future.
|
|
205
|
+
#
|
|
206
|
+
# If this becomes performance sensitive, we can potentially implement
|
|
207
|
+
# something more sophisticated such as lazily creating the condition
|
|
208
|
+
# variable, and synchronizing the creation of that using a global lock.
|
|
235
209
|
while deadline is None or time.time() < deadline:
|
|
236
210
|
if self.result_exception is not None:
|
|
237
211
|
raise self.result_exception
|
|
@@ -248,6 +222,9 @@ class SimpleProducerFuture(Generic[T]):
|
|
|
248
222
|
self.result_exception = exception
|
|
249
223
|
|
|
250
224
|
|
|
225
|
+
ProducerFuture = Union[SimpleProducerFuture[T], Future[T]]
|
|
226
|
+
|
|
227
|
+
|
|
251
228
|
class Producer(Generic[TStrategyPayload], ABC):
|
|
252
229
|
@abstractmethod
|
|
253
230
|
def produce(
|
|
@@ -167,6 +167,15 @@ class TestKafkaStreams(StreamsTestMixin[KafkaPayload]):
|
|
|
167
167
|
else:
|
|
168
168
|
raise AssertionError("expected EndOfPartition error")
|
|
169
169
|
|
|
170
|
+
@pytest.mark.parametrize("use_simple_futures", [True, False])
|
|
171
|
+
def test_producer_future_behavior(self, use_simple_futures: bool) -> None:
|
|
172
|
+
with self.get_topic() as topic:
|
|
173
|
+
with closing(self.get_producer(use_simple_futures)) as producer:
|
|
174
|
+
future = producer.produce(topic, next(self.get_payloads()))
|
|
175
|
+
assert not future.done()
|
|
176
|
+
assert future.result(5.0)
|
|
177
|
+
assert future.done()
|
|
178
|
+
|
|
170
179
|
def test_lenient_offset_reset_latest(self) -> None:
|
|
171
180
|
payload = KafkaPayload(b"a", b"0", [])
|
|
172
181
|
with self.get_topic() as topic:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sentry_arroyo-2.20.10 → sentry_arroyo-2.21.0}/arroyo/processing/strategies/run_task_in_threads.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|