mirror of
https://github.com/Diggsey/sqlxmq.git
synced 2024-11-21 15:51:00 +00:00
Various superficial improvements
This commit is contained in:
parent
4edf49255e
commit
a02cc97e09
5 changed files with 30 additions and 6 deletions
|
@ -1,12 +1,13 @@
|
|||
[package]
|
||||
name = "sqlxmq"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
authors = ["Diggory Blake <diggsey@googlemail.com>"]
|
||||
edition = "2018"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/Diggsey/sqlxmq"
|
||||
description = "A reliable job queue using PostgreSQL as a backing store"
|
||||
readme = "README.md"
|
||||
documentation = "https://docs.rs/sqlxmq"
|
||||
|
||||
[workspace]
|
||||
members = ["sqlxmq_macros"]
|
||||
|
|
17
README.md
17
README.md
|
@ -1,5 +1,9 @@
|
|||
# sqlxmq
|
||||
|
||||
[![CI Status](https://github.com/Diggsey/sqlxmq/workflows/CI/badge.svg)](https://github.com/Diggsey/sqlxmq/actions?query=workflow%3ACI)
|
||||
[![Documentation](https://docs.rs/sqlxmq/badge.svg)](https://docs.rs/sqlxmq)
|
||||
[![crates.io](https://img.shields.io/crates/v/sqlxmq.svg)](https://crates.io/crates/sqlxmq)
|
||||
|
||||
A job queue built on `sqlx` and `PostgreSQL`.
|
||||
|
||||
This library allows a CRUD application to run background jobs without complicating its
|
||||
|
@ -104,6 +108,15 @@ present in other job queues.
|
|||
|
||||
# Getting started
|
||||
|
||||
## Database schema
|
||||
|
||||
This crate expects certain database tables and stored procedures to exist.
|
||||
You can copy the migration files from this crate into your own migrations
|
||||
folder.
|
||||
|
||||
All database items created by this crate are prefixed with `mq`, so as not
|
||||
to conflict with your own schema.
|
||||
|
||||
## Defining jobs
|
||||
|
||||
The first step is to define a function to be run on the job queue.
|
||||
|
@ -167,8 +180,8 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||
The final step is to actually run a job.
|
||||
|
||||
```rust
|
||||
example_job.new()
|
||||
// This is where we override job configuration
|
||||
example_job.builder()
|
||||
// This is where we can override job configuration
|
||||
.set_channel_name("bar")
|
||||
.set_json("John")
|
||||
.spawn(&pool)
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
[package]
|
||||
name = "sqlxmq_macros"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
authors = ["Diggory Blake <diggsey@googlemail.com>"]
|
||||
edition = "2018"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/Diggsey/sqlxmq"
|
||||
description = "Procedural macros for sqlxmq"
|
||||
readme = "../README.md"
|
||||
documentation = "https://docs.rs/sqlxmq"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[lib]
|
||||
|
|
11
src/lib.rs
11
src/lib.rs
|
@ -105,6 +105,15 @@
|
|||
//!
|
||||
//! # Getting started
|
||||
//!
|
||||
//! ## Database schema
|
||||
//!
|
||||
//! This crate expects certain database tables and stored procedures to exist.
|
||||
//! You can copy the migration files from this crate into your own migrations
|
||||
//! folder.
|
||||
//!
|
||||
//! All database items created by this crate are prefixed with `mq`, so as not
|
||||
//! to conflict with your own schema.
|
||||
//!
|
||||
//! ## Defining jobs
|
||||
//!
|
||||
//! The first step is to define a function to be run on the job queue.
|
||||
|
@ -196,7 +205,7 @@
|
|||
//! # pool: sqlx::Pool<sqlx::Postgres>
|
||||
//! # ) -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
|
||||
//! example_job.builder()
|
||||
//! // This is where we override job configuration
|
||||
//! // This is where we can override job configuration
|
||||
//! .set_channel_name("bar")
|
||||
//! .set_json("John")?
|
||||
//! .spawn(&pool)
|
||||
|
|
|
@ -27,7 +27,7 @@ impl<T: Any> DerefMut for Opaque<T> {
|
|||
}
|
||||
}
|
||||
|
||||
/// A handle to a background job which will be automatically cancelled if
|
||||
/// A handle to a background task which will be automatically cancelled if
|
||||
/// the handle is dropped. Extract the inner join handle to prevent this
|
||||
/// behaviour.
|
||||
#[derive(Debug)]
|
||||
|
|
Loading…
Reference in a new issue