No project description provided
Project description
queue-local-python-package
Usage:
Install: pip install queue-local
(Preferable you add queue-local to requirements.txt)
Use the DatabaseQueue
:
from queue_local.database_queue import DatabaseQueue
q = DatabaseQueue()
q.push({"item": "test 1", "action_id": 1})
result = q.peek() # "test 1" is still in the queue
result = q.get() # "test 1" is no longer in the queue
result = q.get_by_action_ids(action_ids=(1, )) # action_ids must be tuple
Inherit from our abstract queue:
from queue_local.our_queue import OurQueue
class YourClass(OurQueue):
def __init__(self):
pass
def push(self, item):
"""push to the queue"""
pass
def get(self):
"""get from the queue (and delete)"""
pass
def peek(self):
"""get the head of the queue (without deleting)"""
pass
# add whatever functions you like, like is_empty()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
queue-local-0.0.7.tar.gz
(1.7 kB
view hashes)
Built Distribution
Close
Hashes for queue_local-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1adcecfffa06b611896adffc0d8f1fb6717b44c2215d16fc44c9179820b013b |
|
MD5 | 482fc9d9e9494963091de249c60e6f71 |
|
BLAKE2b-256 | f321e336f888ed0721cf7cd647807a8d519452d75a3e19870529ec6e1d138386 |