From 742b47c71cc4d77d7a664317e1477c05fb945fc4 Mon Sep 17 00:00:00 2001 From: ivan770 Date: Mon, 8 Jun 2020 18:30:39 +0300 Subject: [PATCH] Add README, change default database path --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++++ spartan/src/server.rs | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..c5baa934 --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +

Spartan MQ

+ +

+ Website | + Documentation +

+ +

+ +

+ +

+ Spartan MQ is a fast and easy to use message queue, written in Rust 🦀 +

+ +## Features +* SQS-like message dispatching +* Rich messages, with support for timezone, timeout, delay, max tries, and states +* Integrated time handling +* Redis-like database persistence using timers +* Background GC that helps you keep your queues tidy +* Simple API + +## Installation + +### Download binary from GitHub + +1. Download latest release from [GitHub](https://github.com/ivan770/spartan/releases/latest). +2. Create Spartan.toml configuration file with example configuration below: +``` +queues = ["default"] +``` +3. Create empty directory with name `db` (you may change directory name using `Spartan.toml`). +4. Run binary using `./spartan`, or `./spartan.exe` if you are using Windows. + +### Build from source + +Make sure you have Rust toolchain installed on your system. + +``` +git clone https://github.com/ivan770/spartan +cd spartan +cargo run --release +``` + +## Configuration + +### Executable flags + +* `--config` - Change configuration file path (default: Spartan.toml). +* `--host` - Change server host (default: 127.0.0.1:5680). + +### Spartan.toml keys + +* `queues` - Array of queue names (required). +* `path` - Database path (default: ./db). +* `persistence_timer` - Amount of seconds between each database write to disk (default: 900). +* `gc_timer` - Amount of seconds between each GC job wake (GC cycle times vary, default: 300). diff --git a/spartan/src/server.rs b/spartan/src/server.rs index 1c808066..5d258b2a 100644 --- a/spartan/src/server.rs +++ b/spartan/src/server.rs @@ -5,7 +5,7 @@ use structopt::StructOpt; use toml::from_slice; fn default_path() -> PathBuf { - PathBuf::from("./spartan") + PathBuf::from("./db") } const fn default_persistence_timer() -> u64 {