RocksDB-based queue with python bindings

Overview

RocksQ

An inproc RocksDB-based queue with Python bindings. It is implemented in Rust.

Features:

  • max capacity limit in number of elements;
  • size calculation based on filesystem space usage;
  • length calculation based on number of elements;
  • supports only bytes-like objects;
  • can operate in a multithreaded environment efficiently (push and pop methods can release GIL if necessary);
  • keeps the state between restarts;
  • two implementations: blocking and nonblocking;

What is not supported:

  • pub/sub is not supported intentionally (implement it on top of RocksQ if necessary);
  • TTL is not supported intentionally (implement it on top of RocksQ if necessary).

Implementation details

It works on RocksDB and uses a single column family. The keys are 64-bit integers, the values are byte arrays. The keys are generated by incrementing a counter. The read and write counters are stored in a separate key-value pairs.

It is implemented in Rust and PyO3, thus allows to release GIL when necessary. The library does not require external dependencies installed in the environment.

Supported Platforms and Python Versions

Windows: Python versions: 3.7-3.12.

Linux: ManyLinux Python versions: 3.7-3.12. CI does not build for PyPy, but it should work if you build it manually.

MacOS: Currently, I do not have MacOS environment to debug the build process in MacOS, all volounteers are welcome.

Installation

pip install rocksq

Usage

See the examples in the python directory.

API docs are located at: https://insight-platform.github.io/RocksQ/.

Performance

The performance is mostly limited by the throughput of the underlying filesystem. The queue is able to saturate the throughput of the filesystem.

You might also like...
Rust implementation of Python command line progress bar tool tqdm.
Rust implementation of Python command line progress bar tool tqdm.

tqdm Rust implementation of Python command line progress bar tool tqdm. From original documentation: tqdm derives from the Arabic word taqaddum (تقدّم

Python/Rust implementations and notes from Proofs Arguments and Zero Knowledge study group

What is this? This is where I'll be collecting resources related to the Study Group on Dr. Justin Thaler's Proofs Arguments And Zero Knowledge Book. T

🐎 A fast implementation of the Aho-Corasick algorithm using the compact double-array data structure. (Python wrapper for daachorse)

python-daachorse daachorse is a fast implementation of the Aho-Corasick algorithm using the compact double-array data structure. This is a Python wrap

A Command-line tool to create, manage and deploy your python projects

PPM A Command-line tool to create, manage and deploy your python projects Table of Contents PPM Main Features Create a Project project.ini file Projec

Fuzzy Index for Python, written in Rust. Works like error-tolerant dict, keyed by a human input.

FuzzDex FuzzDex is a fast Python library, written in Rust. It implements an in-memory fuzzy index that works like an error-tolerant dictionary keyed b

PyOxidizer is a utility for producing binaries that embed Python

PyOxidizer is a utility for producing binaries that embed Python. The over-arching goal of PyOxidizer is to make complex packaging and distribution problems simple so application maintainers can focus on building applications instead of toiling with build systems and packaging tools.

A fast python geohash library created by wrapping rust.

Pygeohash-Fast A Fast geohasher for python. Created by wrapping the rust geohash crate with pyo3. Huge shout out to the georust community :) Currently

Python PEP-440 Version Parsing

PyVer (WIP) Python PEP-440 Version Parsing This package allows for parsing Python PEP-440 version numbers and comparisons between PEP-440 Versions Usa

Python PEP-440 Version Parsing

PyVer Python PEP-440 Version Parser This package allows for parsing Python PEP-440 version numbers and for comparisons between PEP-440 version numbers

Releases(0.1.7)
Owner
In-Sight
In-Sight Open Source Components
In-Sight
Songbird bindings for python

Songbird-Py Songbird bindings for python. The goal is to provide an easy to use alternitive to Lavalink. Its written with rust-bindings to Songbird. S

null 0 Jul 23, 2022
Python bindings for decancer.

decancer_py Python bindings for decancer. Installation You can get started with decancer_py by installing from PyPI: pip install -U decancer-py Usage

Jonxslays 6 Dec 27, 2022
⚡️ Python bindings for a rust implementation of aapleby's MurMurHash.

?? murmurh ?? ⚡️ Python bindings for a rust implementation of aapleby's MurMurHash. ?? Contributing Contributions are welcome! Please feel free to ope

Paul Leydier 6 Jan 14, 2023
PyO3 bindings and Python interface to skani, a method for fast fast genomic identity calculation using sparse chaining.

?? ⛓️ ?? Pyskani PyO3 bindings and Python interface to skani, a method for fast fast genomic identity calculation using sparse chaining. ??️ Overview

Martin Larralde 13 Mar 21, 2023
pyrevm Blazing-fast Python bindings to revm

pyrevm Blazing-fast Python bindings to revm Quickstart make install make test Example Usage Here we show how you can fork from Ethereum mainnet and s

Georgios Konstantopoulos 97 Apr 14, 2023
Pollard's p - 1, in rust, with python bindings

Pollard's p - 1 algorithm for factorization Written in rust, using pyo3 to provide python bindings and primesieve for fast prime enumeration. libprime

Robin Jadoul 4 Sep 26, 2023
My solutions for the Advent of Code 2021 in Scala, Python, Haskell and Rust.

Advent of Code 2021 These are my Advent of Code 2021 solutions written in Scala 3, Haskell, Python and Rust. Day Title L1 L2 L3 L4 01 Sonar Sweep Scal

Axel Suárez 2 Oct 14, 2022
Fast DNA manipulation for Python, written in Rust.

quickdna Quickdna is a simple, fast library for working with DNA sequences. It is up to 100x faster than Biopython for some translation tasks, in part

Secure DNA 22 Dec 31, 2022
A toy example showing how to run Rust code in Python for speed and progress.

PoC: Integrating Rust in Python A toy example showing how to run Rust code in Python for speed and progress. Requirements Python 3.6+ Rust 1.44+ Cargo

Emil Thorenfeldt 2 Feb 7, 2022
This is a simple command line application to convert bibtex to json written in Rust and Python

bibtex-to-json This is a simple command line application to convert bibtex to json written in Rust and Python. Why? To enable you to convert very big

null 3 Mar 23, 2022