\google\appengine\ext\session\MemcacheContainer
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
FINAL
Remove direct interaction with Memcache object for ease of mocking in tests.
Methods
__construct
__construct()
Initialises a Memcache instance
close
close() : boolean
Closes the Memcache instance.
Returns
boolean
true if successful, false otherwise
get
get(string $key) : string
Finds the value associated with input key, from Memcache.
Parameters
Name |
Description |
$key
|
string
Input key from which to find value |
Returns
string
value associated with input key
set
set(string $key, string $value, integer $expire) : boolean
Inserts a key value pair, with expiry time, into Memcache.
Parameters
Name |
Description |
$key
|
string
Input key to associate with the value |
$value
|
string
Input value to be stored |
$expire
|
integer
Time until the pair can be garbage collected |
Returns
boolean
true if successful, false otherwise
delete
delete(string $key) : boolean
Removes the key value pair, keyed with the input variable.
Parameters
Name |
Description |
$key
|
string
Input key to remove key value pair |
Returns
boolean
true if successful, false otherwise
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-07-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-07-21 UTC."],[[["This documentation outlines a class that interacts with Memcache, abstracting direct interaction for easier testing."],["The `close()` method is used to close the Memcache instance, returning `true` on success, and `false` otherwise."],["The `get()` method retrieves a value from Memcache based on a given key."],["The `set()` method inserts a key-value pair into Memcache, with an expiration time parameter."],["The `delete()` method removes a key-value pair from Memcache based on the input key and returns `true` if successful, `false` otherwise."]]],[]]