Skip to content

Commit

Permalink
Various superficial improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Diggsey committed Mar 30, 2021
1 parent 4edf492 commit a02cc97
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[package]
name = "sqlxmq"
version = "0.1.0"
version = "0.1.1"
authors = ["Diggory Blake <[email protected]>"]
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"]
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion sqlxmq_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[package]
name = "sqlxmq_macros"
version = "0.1.0"
version = "0.1.1"
authors = ["Diggory Blake <[email protected]>"]
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]
Expand Down
11 changes: 10 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit a02cc97

Please sign in to comment.