Relicense
This commit is contained in:
parent
68a80085de
commit
fbd614474f
|
@ -2,7 +2,7 @@
|
||||||
name = "background-jobs"
|
name = "background-jobs"
|
||||||
description = "Background Jobs implemented with actix and futures"
|
description = "Background Jobs implemented with actix and futures"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
license-file = "LICENSE"
|
license = "AGPL-3.0"
|
||||||
authors = ["asonix <asonix@asonix.dog>"]
|
authors = ["asonix <asonix@asonix.dog>"]
|
||||||
repository = "https://git.asonix.dog/Aardwolf/background-jobs"
|
repository = "https://git.asonix.dog/Aardwolf/background-jobs"
|
||||||
readme = "README.md"
|
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
|
#### Add Background Jobs to your project
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-rt = "2.0.0"
|
actix-rt = "2.2.0"
|
||||||
background-jobs = "0.9.0"
|
background-jobs = "0.10.0"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
futures = "0.3"
|
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
#### To get started with Background Jobs, first you should define a job.
|
#### 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
|
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
|
```rust
|
||||||
use background_jobs::Job;
|
use background_jobs::Job;
|
||||||
use anyhow::Error;
|
use anyhow::Error;
|
||||||
use futures::future::{ok, Ready};
|
use std::future::{ready, Ready};
|
||||||
|
|
||||||
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
|
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
|
||||||
pub struct MyJob {
|
pub struct MyJob {
|
||||||
|
@ -53,7 +52,7 @@ impl Job for MyJob {
|
||||||
fn run(self, _: Self::State) -> Self::Future {
|
fn run(self, _: Self::State) -> Self::Future {
|
||||||
info!("args: {:?}", self);
|
info!("args: {:?}", self);
|
||||||
|
|
||||||
ok(())
|
ready(Ok(()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -109,7 +108,7 @@ impl Job for MyJob {
|
||||||
fn run(self, state: Self::State) -> Self::Future {
|
fn run(self, state: Self::State) -> Self::Future {
|
||||||
info!("{}: args, {:?}", state.app_name, self);
|
info!("{}: args, {:?}", state.app_name, self);
|
||||||
|
|
||||||
ok(())
|
ready(Ok(()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -132,7 +131,6 @@ use anyhow::Error;
|
||||||
|
|
||||||
#[actix_rt::main]
|
#[actix_rt::main]
|
||||||
async fn main() -> Result<(), Error> {
|
async fn main() -> Result<(), Error> {
|
||||||
env_logger::init();
|
|
||||||
// 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::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.
|
other useful types for implementing a jobs processor and job store.
|
||||||
|
|
||||||
### Contributing
|
### 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
|
### 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
|
Copyright © 2021 Riley Trautman
|
||||||
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
|
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.
|
||||||
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
|
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.
|
||||||
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
|
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/).
|
||||||
project under any other license, especially in proprietary software, the answer is likely no.
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
name = "background-jobs-actix"
|
name = "background-jobs-actix"
|
||||||
description = "in-process jobs processor based on Actix"
|
description = "in-process jobs processor based on Actix"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
license-file = "../LICENSE"
|
license = "AGPL-3.0"
|
||||||
authors = ["asonix <asonix@asonix.dog>"]
|
authors = ["asonix <asonix@asonix.dog>"]
|
||||||
repository = "https://git.asonix.dog/Aardwolf/background-jobs"
|
repository = "https://git.asonix.dog/Aardwolf/background-jobs"
|
||||||
keywords = ["jobs", "processor"]
|
keywords = ["jobs", "processor"]
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
name = "background-jobs-core"
|
name = "background-jobs-core"
|
||||||
description = "Core types for implementing an asynchronous jobs processor"
|
description = "Core types for implementing an asynchronous jobs processor"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
license-file = "../LICENSE"
|
license = "AGPL-3.0"
|
||||||
authors = ["asonix <asonix@asonix.dog>"]
|
authors = ["asonix <asonix@asonix.dog>"]
|
||||||
repository = "https://git.asonix.dog/Aardwolf/background-jobs"
|
repository = "https://git.asonix.dog/asonix/background-jobs"
|
||||||
keywords = ["jobs", "processor"]
|
keywords = ["jobs", "processor"]
|
||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
name = "background-jobs-sled-storage"
|
name = "background-jobs-sled-storage"
|
||||||
description = "Sled storage backend for background-jobs"
|
description = "Sled storage backend for background-jobs"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
license-file = "../LICENSE"
|
license = "AGPL-3.0"
|
||||||
authors = ["asonix <asonix@asonix.dog>"]
|
authors = ["asonix <asonix@asonix.dog>"]
|
||||||
repository = "https://git.asonix.dog/Aardwolf/background-jobs"
|
repository = "https://git.asonix.dog/Aardwolf/background-jobs"
|
||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
|
|
Loading…
Reference in a new issue