forked from iopsystems/rpc-perf
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-adds support for sorted set incremenet and sorted set get scores now that they are in the reworked SDK
- Loading branch information
Showing
6 changed files
with
52 additions
and
13 deletions.
There are no files selected for viewing
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,27 @@ | ||
use super::*; | ||
|
||
use ::momento::cache::{CollectionTtl, SortedSetIncrementScoreRequest}; | ||
|
||
/// Increment the score for a member in a sorted set. | ||
/// | ||
/// NOTE: if a TTL is specified, this command will not refresh the TTL for the | ||
/// collection. | ||
pub async fn sorted_set_increment( | ||
client: &mut CacheClient, | ||
config: &Config, | ||
cache_name: &str, | ||
request: workload::client::SortedSetIncrement, | ||
) -> std::result::Result<(), ResponseError> { | ||
SORTED_SET_INCR.increment(); | ||
|
||
let r = SortedSetIncrementScoreRequest::new(cache_name, &*request.key, &*request.member, request.amount) | ||
.ttl(CollectionTtl::new(request.ttl, false)); | ||
|
||
let result = timeout( | ||
config.client().unwrap().request_timeout(), | ||
client.send_request(r), | ||
) | ||
.await; | ||
|
||
record_result!(result, SORTED_SET_INCR) | ||
} |
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