Skip to content

Commit

Permalink
Add README, change default database path
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan770 committed Jun 8, 2020
1 parent 7c1aa0c commit 742b47c
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<h1 align="center">Spartan MQ</h1>

<h4 align="center">
<a href="https://ivan770.me/spartan">Website</a> |
<a href="https://ivan770.github.io/spartan/spartan_lib/">Documentation</a>
</h4>

<p align="center">
<img src="https://github.com/ivan770/spartan/workflows/Test%20workspace/badge.svg">
</p>

<p align="center">
Spartan MQ is a fast and easy to use message queue, written in Rust 🦀
</p>

## 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).
2 changes: 1 addition & 1 deletion spartan/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 742b47c

Please sign in to comment.