{"repo":"orlandos-nl/MongoQueue","free":true,"listed":false,"github":"https://github.com/orlandos-nl/MongoQueue","clone":"git clone https://github.com/orlandos-nl/MongoQueue.git","description":"MongoDB Job Queue in Swift","language":"Swift","stars":12,"topics":["swift-nio","mongokitten","mongodb","job-queue","server-side-swift"],"license":"MIT","category":"data-pipelines","readme_excerpt":"MongoQueue A MongoKitten based JobQueue for MongoDB. Join our Discord for any questions and friendly banter. Read the Docs for more info. Quick Start Connect to MongoDB with MongoKitten regularly: Select a collection for your job queue: Define your jobs by conforming to ScheduledTask (and implicitly Codable ): Register the task to MongoQueue, before it starts. Start the queue in the background - this is helpful in use inside HTTP applications - or when creating separate workers. Alternatively, run the queue in the foreground and block until the queue is stopped. Only use this if your queue worker is only running as a worker. I.E., it isn't serving users on the side. Queue the task in MongoDB: Tada! Just wait for it to be executed. Testing You can run all currently active jobs in the queue one-by-one using: This will not run any jobs scheduled for the future, and will exit once there are no current jobs available. Parallelisation You can set the parallelisation amount per job queue instance using the following code: If you have two containers running an instance of MongoQueue, it will therefore be able to run 2 6 = 12 jobs simultaneously. Integrate with Vapor To access the queue from your Vapor Request, add the following snippet: From here, you can add tasks as such: Advanced Use Before diving into more (detailed) APIs, here's an overview of how this works: When you queue a task, it is used to derive the basic information for queueing the job. Parts of these requirements are i","default_branch":null,"files":null,"tree":[],"storefront":"/r/orlandos-nl","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/orlandos-nl/MongoQueue/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}