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.src.database_queue import DatabaseQueue
q = DatabaseQueue()
q.push({"item": "test 1", "action_id": 1, "parameters_json": "{'a': 1, 'b': 2}"})
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 a tuple
Inherit from our abstract queue:
from queue_local.src.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.9.tar.gz
(1.7 kB
view hashes)
Built Distribution
Close
Hashes for queue_local-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99957439a44b91b582ead552df68691d2dcfff12fbf093df170622f3df66d09c |
|
MD5 | 358ea83546f629b69c263354f95d3a7d |
|
BLAKE2b-256 | dc9c020619e71a3916dd7cdee50a349aa82a3216c9a14c739629ee6f801e8dbd |