Skip to content

Commit

Permalink
Sarthak | Adds rejection of put if the key exists as a part of the co…
Browse files Browse the repository at this point in the history
…de level documentation
  • Loading branch information
SarthakMakhija committed May 26, 2023
1 parent f3275da commit 3f69f62
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cache/cached.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ impl<Key, Value> CacheD<Key, Value>
///
/// Weight is calculated by the weight calculation function provided as a part of `Config`.
///
/// [`crate::cache::command::CommandStatus::Rejected`] is returned to the clients if the key already exists, since v0.0.2.
///
/// `put` is not an immediate operation. Every invocation of `put` results in `crate::cache::command::CommandType::Put` to the `CommandExecutor`.
/// `CommandExecutor` in turn delegates to the `AdmissionPolicy` to perform the put operation.
/// `AdmissionPolicy` may accept or reject the key/value pair depending on the available cache weight.
Expand All @@ -136,6 +138,8 @@ impl<Key, Value> CacheD<Key, Value>
///
/// Weight is provided by the clients.
///
/// [`crate::cache::command::CommandStatus::Rejected`] is returned to the clients if the key already exists, since v0.0.2.
///
/// `put_with_weight` is not an immediate operation. Every invocation of `put_with_weight` results in `crate::cache::command::CommandType::Put` to the `CommandExecutor`.
/// `CommandExecutor` in turn delegates to the `AdmissionPolicy` to perform the put operation.
/// `AdmissionPolicy` may accept or reject the key/value pair depending on the available cache weight.
Expand Down Expand Up @@ -170,6 +174,8 @@ impl<Key, Value> CacheD<Key, Value>
///
/// Weight is calculated by the weight calculation function provided as a part of `Config`.
///
/// [`crate::cache::command::CommandStatus::Rejected`] is returned to the clients if the key already exists, since v0.0.2.
///
/// `put_with_ttl` is not an immediate operation. Every invocation of `put_with_ttl` results in `crate::cache::command::CommandType::PutWithTTL` to the `CommandExecutor`.
/// `CommandExecutor` in turn delegates to the `AdmissionPolicy` to perform the put operation.
/// `AdmissionPolicy` may accept or reject the key/value pair depending on the available cache weight.
Expand Down Expand Up @@ -204,6 +210,8 @@ impl<Key, Value> CacheD<Key, Value>
///
/// Weight is provided by the clients.
///
/// [`crate::cache::command::CommandStatus::Rejected`] is returned to the clients if the key already exists, since v0.0.2.
///
/// `put_with_weight_and_ttl` is not an immediate operation. Every invocation of `put_with_weight_and_ttl` results in `crate::cache::command::CommandType::PutWithTTL` to the `CommandExecutor`.
/// `CommandExecutor` in turn delegates to the `AdmissionPolicy` to perform the put operation.
/// `AdmissionPolicy` may accept or reject the key/value pair depending on the available cache weight.
Expand Down

0 comments on commit 3f69f62

Please sign in to comment.