Open ajac-zero opened 4 weeks ago
Attention: Patch coverage is 50.00000%
with 17 lines
in your changes are missing coverage. Please review.
Project coverage is 95.00%. Comparing base (
94cd878
) to head (1b44875
). Report is 11 commits behind head on main.
@ajac-zero This may need a unit-test with stream
enabled.
Sure thing @gaby . I was wondering how I should go about that...
What I started doing was add a stream parameter to the worker tests, and then wrap them so they run twice, once with stream and once without.
But I feel this might not be the best way to do things, maybe I should focus on some vital tests? What do you suggest?
@ajac-zero That's probably a great starting point, running current tests with "stream" set to false. Then running the test suite with "stream" set to True. This will require setting the source of the data to use Streams.
This pull request adds a basic implementation of Redis Streams, in order to avoid polling for new jobs in the worker and reduce latency, in accordance with objective 4 of issue #437.
To create a worker that listens to a Redis Stream, we can use the cli or specify it in the code directly.
CLI:
arq worker.WorkerSettings --stream
Code:
On the client, they must specify that they want to deliver a job to a worker through a Redis Stream.
Here are the results of a very simple benchmark that showcases the potential of using Redis Streams for improved latency.
Polling:
Average time: 0.268s
Streaming:
Average time: 0.012s