Releases: vapor/queues
Releases · vapor/queues
Bail early if no scheduled jobs exist
If no scheduled jobs exist, fail early from the process to avoid running the worker unnecessarily.
Fix everySecond bug
This update fixes a bug that caused everySecond()
not to fire when running scheduled jobs.
Support for In-Process workers
Jobs can now run as an in-process worker instead of a separate worker side-by-side with the main application:
try JobsCommand(application: app, scheduled: false).startJobs(on: .default)
Or:
try JobsCommand(application: app, scheduled: true).startScheduledJobs()
Jobs 1.0.0 Beta 3
- Updated to latest Vapor beta 2 release (#48)
import Jobs
import Vapor
let email = Email()
app.jobs.add(email)
try app.jobs.use(.redis(url: "redis://\(hostname):6379"))
app.get("send-email") { req in
req.jobs.dispatch(Email.self, .init(to: "tanner@vapor.codes"))
.map { HTTPStatus.ok }
}
- Enabled test discovery on Linux. (#49)
Beta 2.1.0
Adds a new .at()
API on ScheduledJob
for one-off jobs with a specific date
Beta 2.0.0
Breaking Changes:
Dispatching jobs is now more type safe:
app.get("foo") { req in
return req.jobs.dispatch(FooJob.self, .init(foo: "bar"))
.map { "done" }
}
Beta 1.0.2
New registration API (#43):
let app = Application(environment: env)
app.provider(JobsProvider())
app.jobs.driver(TestDriver())
app.jobs.add(FooJob())
app.jobs.add(BarJob())
app.jobs.add(QuxJob())
Beta 1.0.1
Quick patch to fix a delayUntil
bug (#42)
Beta 1
- Update to Vapor Beta 1
- You can now access the jobs worker via
req.jobs
- The new configuration setup looks like this:
let app = Application(environment: env)
app.provider(JobsProvider())
app.register(JobsDriver.self) { app in
return TestDriver(on: app.make())
}
app.register(extension: JobsConfiguration.self) { jobs, app in
jobs.add(FooJob())
}
return app
- Added a new
queuedAt
property to theJobStorage
object - Added informational dispatch log
Scheduled Jobs
New:
- Vapor Jobs now has scheduled jobs