A queue system for Vapor.
Misc cleanups by @gwynne in #123
- Update Swift minimum version to 5.6 to match Vapor
- CI updates
Thanks to the reviewers for their help:
Full Changelog: https://github.com//compare/1.12.1...1.13.0
Match Vapor's support
AsyncJobEventDelegate
for async hooksLock
with NIOLock
Fixes a few typo'd log messages.
Adds a new using(_:)
API to the ScheduleBuilder
to allow the calendar to be set when creating jobs on a schedule
This PR introduces the ability to pass a custom Calendar
to the ScheduleBuilder
.
I ran into an edge case where I have queues deployed across multiple regions and needed to schedule jobs based on specific time zones.
I also cleaned up some unused computed properties in the ScheduleBuilderTests
suite.
This removes support for Swift 5.2 and Swift 5.3, making Swift 5.4 the earliest supported version as announced
This PR allows client apps to conform to the previously-added AsyncScheduledJob
protocol by making it, and the associated adapter function from ScheduledJob
, public.
Allows AsyncJob
s to be added to the app via app.queues.add(...)
method.
Adds AsyncJob
which allows you to specify a job that has async body implementations:
struct MyJobPayload: Content {
let name: String
}
struct MyAsyncJob: AsyncJob {
func dequeue(context: QueueContext, payload: MyJobPayload) async throws {
print(payload.name)
}
func error(context: QueueContext, error: Error, payload: MyJobPayload) async throws {
print(error)
}
}
// In configure.swift
app.queues.add(MyAsyncJob())