
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Task queue built on mongo with channels and unique job id.
Website • autobotAI Automation Platform
Inspired by kapilt/mongoqueue
delay
while queuing a new job. This allows user to delay the job execution by x seconds. It is similar to sleep
but this allows the functionality for the fresh jobs.complete
method to retry 3 times while pulling the dependencies.Install the package.
pip install mongo_queue
from mongo_queue.queue import Queue
from pymongo import MongoClient
queue = Queue(MongoClient('localhost', 27017).task_queue, consumer_id="consumer-1", timeout=300, max_attempts=3)
queue.put({"task_id": 1})
queue.put({"task_id": 1}, priority=1)
queue.put({"task_id": 1}, priority=1, channel="channel_1")
queue.put({"task_id": 1}, priority=1, channel="channel_1", job_id="x_job")
job1 = queue.put({"task_id": 1}, priority=1, channel="channel_1", job_id="x_job")
job2 = queue.put({"task_id": 2}, priority=1, channel="channel_1", job_id="x_job", depends_on=[job1])
job = queue.next()
job = queue.next(channel="channel_1")
job.progress(count=10)
sleep
in seconds. The job will not be picked up again till the sleep time expires.state
you can store state in the job for long running jobs.job.release()
# or
job.release(sleep=10, state={"some": "state"})
job.error("Some error occured")
job.complete()
# Setup venv of python version 3.6 and above
python3.12 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install wheel
pip install --upgrade twine
rm -rf dist
# Goto https://pypi.org/manage/account/token/ and capture the `$HOME/.pypirc` config and create the file.
vim $HOME/.pypirc
python setup.py sdist bdist_wheel
python -m twine upload -r pypi dist/*
export MONGO_URI=mongodb+srv://username:pwd@mongourl/test?retryWrites=true&w=majority
cd mong_queue # Root directory of the package
python3.9 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 -m unittest mongo_queue.test
FAQs
Queue service built on top of mongo.
We found that mongo-queue-service demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.