Skip to content

Instantly share code, notes, and snippets.

@xtetsuji
Created July 26, 2013 12:38
Show Gist options
  • Select an option

  • Save xtetsuji/6088544 to your computer and use it in GitHub Desktop.

Select an option

Save xtetsuji/6088544 to your computer and use it in GitHub Desktop.
Cache::SharedMemoryCache concept code.
#!/usr/bin/env perl
use strict;
use Cache::SharedMemoryCache;
my $cache = Cache::SharedMemoryCache->new({namespace => 'foo', default_expire_in => "60s"});
while (1) {
sleep 1;
print $cache->get('bar')."\n";
}
#!/usr/bin/env perl
use strict;
use Cache::SharedMemoryCache;
my $cache = Cache::SharedMemoryCache->new({namespace => 'foo', default_expire_in => "60s"});
while (1) {
$cache->set('bar', time, 3);
sleep 3;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment