-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a redis reliable queue implementation (#133)
* adds project to vscode rust-analyzer config it asked me to * redis reliable queue implementation * readme * cleanup * shit fixed * proper redis response handling for lpop * more clean * okay better handling i GUESS * updated redis crate, all my tests pass breaking changes don't apply either * update the cargo lock to 2.0.0 * ignore clippy for the redis_lpush match return * fixes cellularnoise clippy lints
- Loading branch information
Showing
9 changed files
with
237 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
{ | ||
"rust-analyzer.cargo.target": "i686-pc-windows-msvc" | ||
"rust-analyzer.cargo.target": "i686-pc-windows-msvc", | ||
"rust-analyzer.linkedProjects": [ | ||
".\\Cargo.toml" | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Connects to a given redis server. | ||
* | ||
* Arguments: | ||
* * addr - The address of the server, for example "redis://127.0.0.1/" | ||
*/ | ||
#define rustg_redis_connect_rq(addr) RUSTG_CALL(RUST_G, "redis_connect_rq")(addr) | ||
/** | ||
* Disconnects from a previously connected redis server | ||
*/ | ||
/proc/rustg_redis_disconnect_rq() return RUSTG_CALL(RUST_G, "redis_disconnect_rq")() | ||
/** | ||
* https://redis.io/commands/lpush/ | ||
* | ||
* Arguments | ||
* * key (string) - The key to use | ||
* * elements (list) - The elements to push, use a list even if there's only one element. | ||
*/ | ||
#define rustg_redis_lpush(key, elements) RUSTG_CALL(RUST_G, "redis_lpush")(key, json_encode(elements)) | ||
/** | ||
* https://redis.io/commands/lrange/ | ||
* | ||
* Arguments | ||
* * key (string) - The key to use | ||
* * start (string) - The zero-based index to start retrieving at | ||
* * stop (string) - The zero-based index to stop retrieving at (inclusive) | ||
*/ | ||
#define rustg_redis_lrange(key, start, stop) RUSTG_CALL(RUST_G, "redis_lrange")(key, start, stop) | ||
/** | ||
* https://redis.io/commands/lpop/ | ||
* | ||
* Arguments | ||
* * key (string) - The key to use | ||
* * count (string|null) - The amount to pop off the list, pass null to omit (thus just 1) | ||
* | ||
* Note: `count` was added in Redis version 6.2.0 | ||
*/ | ||
#define rustg_redis_lpop(key, count) RUSTG_CALL(RUST_G, "redis_lpop")(key, count) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.