https://github.com/vapor-community/queues-mongo-driver
A MongoDB implementation for https://github.com/vapor/queues
https://github.com/vapor-community/queues-mongo-driver
Last synced: 5 months ago
JSON representation
A MongoDB implementation for https://github.com/vapor/queues
- Host: GitHub
- URL: https://github.com/vapor-community/queues-mongo-driver
- Owner: vapor-community
- Created: 2020-05-05T03:41:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T09:17:02.000Z (almost 3 years ago)
- Last Synced: 2025-04-13T22:17:41.322Z (6 months ago)
- Language: Swift
- Homepage:
- Size: 13.7 KB
- Stars: 6
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# QueuesMongoDriver
## A MongoDB driver for Vapor Queues
## Getting Started
To install queues-mongo-driver add the following dependency to your `Package.swift`:
`.package(url: "https://github.com/vapor-community/queues-mongo-driver.git", from: "1.0.0"),`
This driver depends on [MongoKitten](https://github.com/OpenKitten/MongoKitten) so to configure the driver we need an instance of a `MongoDatabase`. Ideally during app startup or in your `configure.swift`:
```swift
import QueuesMongoDriver
import MongoKittenfunc configure(app: Application) throws {
let mongoDatabase = try MongoDatabase.lazyConnect("mongodb://localhost:27017/my-database", on: app.eventLoopGroup.next())
// Setup Indexes for the Job Schema for performance (Optional)
try app.queues.setupMongo(using: mongoDatabase)
app.queues.use(.mongodb(mongoDatabase))
}
```