Skip to main content

Logo

Queue server base on RocksDB as a KV-Store backend and gRPC as an interface

license Python Build PyPi

Table of Contents

About The Project

Garrison is a RocksDB wrapped in a gRPC service to expose some high level functionalities. Garrison is also implments queue functionalities on the top of RocksDB KV store functionalities.

Built With

Prerequisites

In order to pip install rocksdb you will need to install the following distro packages

  • Ubuntu 18.04
sudo apt install librocksdb-dev libsnappy-dev liblz4-dev

Installation

pip3 install garrison-server

Usage

Server

python3 -m garrison.server --database-path=/data/garrison_db --port=10000

Client

import garrison.client

client = garrison.client.GarrisonClient(
    host='127.0.0.1',
    port=10000,
)

# Sets a key inside the database - return whether the key is new or existed
client.key_set(
    key=b'key_name',
    value=b'value',
)
# Retrieving a key - return None if key does not exist
value = client.key_get(
    key=b'key_name',
)
# Deletes a key inside the database - return whether the key is deleted or wasn't existed
deleted_successfuly = client.key_delete(
    key=b'key_name',
)


# Push items into a queue.
# Priority is either NORMAL or HIGH, and controls whether the items will be pushed on the top or buttom of the queue
client.queue_push(
    queue_name=b'queue_name',
    items=[
        b'item one',
        b'item two',
        b'item three',
    ],
    priority='NORMAL',
)
# Get the number of items in the queue
number_of_items = client.queue_length(
    queue_name=b'queue_name',
)
# Pulling items from the queue - return list of items. HIGH priority first.
items = client.queue_pop(
    queue_name=b'queue_name',
    number_of_items=3,
)
# Deletes a key inside the database - return whether the key is deleted or wasn't existed
deleted_successfuly = client.queue_delete(
    queue_name=b'queue_name',
)

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Gal Ben David - intsights@gmail.com

Project Link: https://github.com/intsights/garrison

Metadata

Release files for garrison-server 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for garrison-server 0.1.0
File Size Uploaded Provenance Actions
garrison-server-0.1.0.tar.gz 22.0 kB Without provenance Details for garrison-server-0.1.0.tar.gz

Release files / garrison-server-0.1.0.tar.gz

Download URL garrison-server-0.1.0.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2bb3ad6da79c6ec04bb4cd10a06bca6bc3bca3c7416adaa774785b1987b8acaf
BLAKE2b-256 checksum
How to use checksums
23ec5343371e51ab8a9ce78064fbbc697f36cd16067bfb5024099db99987e46c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

Security for garrison-server 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page