Skip to main content

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


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)

Uploaded Source

Built Distribution

queue_local-0.0.7-py3-none-any.whl (1.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page