文件名称:p5-keyedmutex-memcached:使用 memcached 的键控互斥锁
文件大小:15KB
文件格式:ZIP
更新时间:2024-07-12 12:11:44
名称 KeyedMutex::Memcached - 使用 memcached 的进程间键控互斥锁 概要 use KeyedMutex::Memcached; my $key = 'query:XXXXXX'; my $cache = Cache::Memcached::Fast->new( ... ); my $mutex = KeyedMutex::Memcached->new( cache => $cache ); until ( my $value = $cache->get($key) ) { { if ( my $lock = $mutex->lock( $key, 1 ) ) { #locked read from DB $value = get_from_db($key); $cache->set($key, $valu
【文件预览】:
p5-keyedmutex-memcached-master
----xt()
--------perlcriticrc(51B)
--------02_perlcritic.t(219B)
----t()
--------compile.t(81B)
--------basic.t(3KB)
----lib()
--------KeyedMutex()
----Changes(616B)
----Build.PL(301B)
----minil.toml(85B)
----LICENSE(18KB)
----README.md(2KB)
----META.json(2KB)
----.gitignore(210B)
----cpanfile(433B)