mirror of
https://git.asonix.dog/asonix/background-jobs.git
synced 2024-11-26 22:10:59 +00:00
Relicense
This commit is contained in:
parent
68a80085de
commit
fbd614474f
6 changed files with 626 additions and 385 deletions
|
@ -2,7 +2,7 @@
|
|||
name = "background-jobs"
|
||||
description = "Background Jobs implemented with actix and futures"
|
||||
version = "0.10.0"
|
||||
license-file = "LICENSE"
|
||||
license = "AGPL-3.0"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
repository = "https://git.asonix.dog/Aardwolf/background-jobs"
|
||||
readme = "README.md"
|
||||
|
|
33
README.md
33
README.md
|
@ -13,21 +13,20 @@ might not be the best experience.
|
|||
#### Add Background Jobs to your project
|
||||
```toml
|
||||
[dependencies]
|
||||
actix-rt = "2.0.0"
|
||||
background-jobs = "0.9.0"
|
||||
actix-rt = "2.2.0"
|
||||
background-jobs = "0.10.0"
|
||||
anyhow = "1.0"
|
||||
futures = "0.3"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
```
|
||||
|
||||
#### To get started with Background Jobs, first you should define a job.
|
||||
Jobs are a combination of the data required to perform an operation, and the logic of that
|
||||
operation. They implment the `Job`, `serde::Serialize`, and `serde::DeserializeOwned`.
|
||||
operation. They implement the `Job`, `serde::Serialize`, and `serde::DeserializeOwned`.
|
||||
|
||||
```rust
|
||||
use background_jobs::Job;
|
||||
use anyhow::Error;
|
||||
use futures::future::{ok, Ready};
|
||||
use std::future::{ready, Ready};
|
||||
|
||||
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct MyJob {
|
||||
|
@ -53,7 +52,7 @@ impl Job for MyJob {
|
|||
fn run(self, _: Self::State) -> Self::Future {
|
||||
info!("args: {:?}", self);
|
||||
|
||||
ok(())
|
||||
ready(Ok(()))
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -109,7 +108,7 @@ impl Job for MyJob {
|
|||
fn run(self, state: Self::State) -> Self::Future {
|
||||
info!("{}: args, {:?}", state.app_name, self);
|
||||
|
||||
ok(())
|
||||
ready(Ok(()))
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -132,7 +131,6 @@ use anyhow::Error;
|
|||
|
||||
#[actix_rt::main]
|
||||
async fn main() -> Result<(), Error> {
|
||||
env_logger::init();
|
||||
// Set up our Storage
|
||||
// For this example, we use the default in-memory storage mechanism
|
||||
use background_jobs::memory_storage::Storage;
|
||||
|
@ -167,15 +165,14 @@ If you want to create your own jobs processor based on this idea, you can depend
|
|||
other useful types for implementing a jobs processor and job store.
|
||||
|
||||
### Contributing
|
||||
Feel free to open issues for anything you find an issue with. Please note that any contributed code will be licensed under the GPLv3.
|
||||
Feel free to open issues for anything you find an issue with. Please note that any contributed code will be licensed under the AGPLv3.
|
||||
|
||||
### License
|
||||
This work is licensed under the Cooperative Software License. This is not a Free Software
|
||||
License, but may be considered a "source-available License." For most hobbyists, self-employed
|
||||
developers, worker-owned companies, and cooperatives, this software can be used in most
|
||||
projects so long as this software is distributed under the terms of the CSL. For more
|
||||
information, see the provided LICENSE file. If none exists, the license can be found online
|
||||
[here](https://lynnesbian.space/csl/). If you are a free software project and wish to use this
|
||||
software under the terms of the GNU Affero General Public License, please contact me at
|
||||
[asonix@asonix.dog](mailto:asonix@asonix.dog) and we can sort that out. If you wish to use this
|
||||
project under any other license, especially in proprietary software, the answer is likely no.
|
||||
|
||||
Copyright © 2021 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 distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. This file is part of background-jobs.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with background-jobs. If not, see [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
name = "background-jobs-actix"
|
||||
description = "in-process jobs processor based on Actix"
|
||||
version = "0.10.0"
|
||||
license-file = "../LICENSE"
|
||||
license = "AGPL-3.0"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
repository = "https://git.asonix.dog/Aardwolf/background-jobs"
|
||||
keywords = ["jobs", "processor"]
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
name = "background-jobs-core"
|
||||
description = "Core types for implementing an asynchronous jobs processor"
|
||||
version = "0.10.0"
|
||||
license-file = "../LICENSE"
|
||||
license = "AGPL-3.0"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
repository = "https://git.asonix.dog/Aardwolf/background-jobs"
|
||||
repository = "https://git.asonix.dog/asonix/background-jobs"
|
||||
keywords = ["jobs", "processor"]
|
||||
readme = "../README.md"
|
||||
edition = "2018"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
name = "background-jobs-sled-storage"
|
||||
description = "Sled storage backend for background-jobs"
|
||||
version = "0.10.0"
|
||||
license-file = "../LICENSE"
|
||||
license = "AGPL-3.0"
|
||||
authors = ["asonix <asonix@asonix.dog>"]
|
||||
repository = "https://git.asonix.dog/Aardwolf/background-jobs"
|
||||
readme = "../README.md"
|
||||
|
|
Loading…
Reference in a new issue