This Flask application provides a key-value store with support for operations such as setting values, getting values, pushing and popping values from a queue.
This endpoint pops a value from the queue at the given key.
key (required): The key of the queue to pop a value from. Returns
result: The value that was popped from the queue. error: An error message if the operation was unsuccessful.
This endpoint blocks until a value is available to pop from the queue at the given key, or until the specified timeout has elapsed.
key (required): The key of the queue to pop a value from. timeout (optional): The maximum amount of time to block, in seconds. Defaults to 0 (no timeout). Returns result: The value that was popped from the queue. error: An error message if the operation was unsuccessful.
This endpoint sets a value for the given key.
key (required): The key to set the value for.
value (required): The value to set.
expiry (optional): The expiration time for the key-value pair, in seconds.
condition (optional): The condition for the set operation. Possible values are "NX" (set the value only if the key does not already exist) and "XX" (set the value only if the key already exists).
Returns
success: Whether the operation was successful.
message: A message indicating the result of the operation.
This endpoint retrieves the value for the given key.
key (required): The key to retrieve the value for. Returns result: The value for the given key. error: An error message if the operation was unsuccessful.
This endpoint pushes one or more values to the queue at the given key.
key (required): The key of the queue to push values to. values (required): A list of values to push to the queue. Returns result: The new length of the queue. error: An error message if the operation was unsuccessful. Functions key_valid Checks whether the given key exists in the store and is not expired.
Sets the given value for the given key in the store, optionally with an expiration time and a condition for the operation.
Retrieves the value for the given key from the store.
Pushes one or more values to the queue at the given key in the store.
Pops a value from the queue at the given key in the store.
Blocks until a value is available to pop from the queue at the given key in the store, or until the specified timeout has elapsed.