mirror of
https://git.asonix.dog/asonix/background-jobs.git
synced 2024-11-25 05:21:00 +00:00
Update readme
This commit is contained in:
parent
250d2f0a33
commit
1ddfd7ef54
1 changed files with 6 additions and 6 deletions
12
README.md
12
README.md
|
@ -14,7 +14,7 @@ might not be the best experience.
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-rt = "2.2.0"
|
actix-rt = "2.2.0"
|
||||||
background-jobs = "0.10.0"
|
background-jobs = "0.13.0"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
```
|
```
|
||||||
|
@ -133,14 +133,14 @@ use anyhow::Error;
|
||||||
async fn main() -> Result<(), Error> {
|
async fn main() -> Result<(), Error> {
|
||||||
// Set up our Storage
|
// Set up our Storage
|
||||||
// For this example, we use the default in-memory storage mechanism
|
// For this example, we use the default in-memory storage mechanism
|
||||||
use background_jobs::memory_storage::Storage;
|
use background_jobs::memory_storage::{ActixTimer, Storage};
|
||||||
let storage = Storage::new();
|
let storage = Storage::new(ActixTimer);
|
||||||
|
|
||||||
// Configure and start our workers
|
// Configure and start our workers
|
||||||
let queue_handle = WorkerConfig::new(move || MyState::new("My App"))
|
let queue_handle = WorkerConfig::new(storage, move || MyState::new("My App"))
|
||||||
.register::<MyJob>()
|
.register::<MyJob>()
|
||||||
.set_worker_count(DEFAULT_QUEUE, 16)
|
.set_worker_count(DEFAULT_QUEUE, 16)
|
||||||
.start(storage);
|
.start();
|
||||||
|
|
||||||
// Queue our jobs
|
// Queue our jobs
|
||||||
queue_handle.queue(MyJob::new(1, 2))?;
|
queue_handle.queue(MyJob::new(1, 2))?;
|
||||||
|
@ -166,7 +166,7 @@ Feel free to open issues for anything you find an issue with. Please note that a
|
||||||
|
|
||||||
### License
|
### License
|
||||||
|
|
||||||
Copyright © 2021 Riley Trautman
|
Copyright © 2022 Riley Trautman
|
||||||
|
|
||||||
background-jobs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
background-jobs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue