Skip to content

Instantly share code, notes, and snippets.

View s3rius's full-sized avatar
:shipit:
Making memes and production-ready systems

Pavel Kirilin s3rius

:shipit:
Making memes and production-ready systems
View GitHub Profile
@s3rius
s3rius / Cargo.toml
Last active June 25, 2024 14:17
PyO3-asyncio async streams
[package]
name = "itertest"
version = "0.1.0"
edition = "2021"
[dependencies]
futures = "0.3.28"
pyo3 = "0.19.2"
pyo3-asyncio = { version = "0.19.0", features = ["tokio-runtime"] }
tokio = { version = "1.32.0", features = ["sync"] }
@s3rius
s3rius / README.md
Last active September 24, 2023 15:27
ScyllaPy benchmarks

To run the benchmark install:

pip install scyllapy acsylla uvloop

And then run it with scylla ip address as the first positional argument. For example:

python benches.py "172.29.0.2" --uvloop
@s3rius
s3rius / README.md
Last active April 26, 2024 10:58
Dynamic schedule source for taskiq.

Here's an example of dynamic scheduler for taskiq. It uses postgres to store all tasks.

We created custom schedule source that is capable of storing and retrieving scheduled tasks.

Start workers by running:

taskiq worker tkq:broker --fs-discover
@s3rius
s3rius / README.md
Created July 23, 2023 10:19
Taskiq router for multiple brokers

This router manages to operate with multiple brokers. The idea is pretty straightforward, you define which broker runs on which node, they use the same url, but different queues.

Running default worker command will not work, since it wouldn't be able to decide which broker to run. To surpass this issue, we can define custom receiver class, which picks a broker based on node parameter.

Now insted of

taskiq worker a:router