Last active
February 7, 2024 20:36
-
-
Save computermouth/432cd0c71aef66bb651bb6b0aaf4dfeb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// ==== CURRENT ==== | |
// insert | |
mystore.insert(&key1, MSG2); | |
// insert async | |
let in_handle = mystore.insert_async(&key1, MSG2)?; | |
store.pending_insert_wait(in_handle); | |
// (in-review) buildable insert | |
store.build_insert(&key1, MSG1) | |
.mode(InsertMode::Add) | |
.time_to_live(std::time::Duration::from_secs(5)) | |
.metadata("mymetadata") | |
.if_generation_match(1234) | |
.execute(); | |
// (todo) buildable insert async | |
let in_handle = store.build_insert(&key1, MSG1) | |
.mode(InsertMode::Add) | |
.time_to_live(std::time::Duration::from_secs(5)) | |
.metadata("mymetadata") | |
.if_generation_match(1234) | |
.execute_async(); | |
store.pending_insert_wait(in_handle); | |
// ==== ALTERNATIVE ==== | |
// buildable without options | |
mystore.insert(&key1, MSG2).execute(); | |
// async buildable without options | |
let in_handle = mystore.insert(&key1, MSG2).execute_async()?; | |
store.pending_insert_wait(in_handle); | |
// buildable with options | |
store.insert(&key1, MSG1) | |
.mode(InsertMode::Add) | |
.time_to_live(std::time::Duration::from_secs(5)) | |
.metadata("mymetadata") | |
.if_generation_match(1234) | |
.execute(); | |
// async buildable with options | |
let in_handle = store.build_insert(&key1, MSG1) | |
.mode(InsertMode::Add) | |
.time_to_live(std::time::Duration::from_secs(5)) | |
.metadata("mymetadata") | |
.if_generation_match(1234) | |
.execute_async(); | |
store.pending_insert_wait(in_handle); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment