memcache и подстановочные знаки

Определите недостающий символ в файле cpp.

// Apparently Microsoft forgot to define a symbol for codecvt.
// Works with /MT only
#include <locale>

#if (!_DLL) && (_MSC_VER >= 1900 /* VS 2015*/) && (_MSC_VER <= 1911 /* VS 2017 */)
std::locale::id std::codecvt<char16_t, char, _Mbstatet>::id;
#endif
30
задан GivP 20 October 2009 в 16:41
поделиться

1 ответ

No, there isn't a direct easy way to do this. The FAQ addresses this, and provides a kind of workaround:

Deleting by Namespace

While memcached does not support any type of wildcard deleting or deletion by namespace (since there are not namespaces), there are some tricks that can be used to simulate this. They do require extra trips to the memcached servers however.

Example, in PHP, for using a namespace called foo:

$ns_key = $memcache->get("foo_namespace_key");
// if not set, initialize it
if($ns_key===false) {
    $ns_key=rand(1, 10000);
    $memcache->set("foo_namespace_key", $ns_key);
}
// cleverly use the ns_key
$my_key = "foo_".$ns_key."_12345";
$my_val = $memcache->get($my_key);

//To clear the namespace do:
$memcache->increment("foo_namespace_key");
49
ответ дан 27 November 2019 в 22:14
поделиться
Другие вопросы по тегам:

Похожие вопросы: