Created
July 26, 2013 12:38
-
-
Save xtetsuji/6088544 to your computer and use it in GitHub Desktop.
Cache::SharedMemoryCache concept code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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