Coder Social home page Coder Social logo

perl6-cache-memcached's Introduction

Cache::Memcached Build Status

Perl6 client for memcached a distributed caching daemon.

Synopsis

  use Cache::Memcached;

  my $memd = Cache::Memcached.new;

  $memd.set("my_key", "Some value");

  $memd.incr("key");
  $memd.decr("key");
  $memd.incr("key", 2);

Or you can use it as an Associative type:

use Cache::Memcached;

my $memd = Cache::Memcached.new;

$memd<my_key> = "Some value";
say $memd<my_key>;
$memd<my_key>:delete;

Description

This provides an interface to the memcached daemon. You will need to have access to a memcached server to be able to use it.

Currently there is no support for compression or the serialization of structured objects (though both could be provided by the agency of external modules.)

Installation

Assuming you have a working Rakudo Perl 6 installation you should be able to install this with zef :

# From the source directory

zef install .

# Remote installation

zef install Cache::Memcached

There should be no reason that it won't work with any new installer that may come along in the future.

Support

Suggestions/patches are welcomed via github at

https://github.com/cosimo/perl6-cache-memcached/issues

perl6-cache-memcached's People

Contributors

cosimo avatar jonathanstowe avatar lizmat avatar szabgab avatar zoffixznet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

perl6-cache-memcached's Issues

incr("key") does not seem to work

The README inicates it should but when I try it I get:

use v6;
use Cache::Memcached;

my $memd = Cache::Memcached.new;

say $memd.incr("counter");

Too few positionals passed; expected 3 arguments but got 2

This is Rakudo version 2017.06 built on MoarVM version 2017.06
same with
This is Rakudo version 2017.07 built on MoarVM version 2017.07

zef install: unable to find a META6.json file

$ zef install Cache::Memcached
===> Searching for: Cache::Memcached
===> Searching for missing dependencies: String::CRC32
===> Extraction: Failed to find a META6.json file for Cache::Memcached:ver<0.04>:authgithub:cosimo -- failure is likely
No meta file? Path: /tmp/.zef/1681727943.13058/Cache%3A%3AMemcached%3Aver%3C0.04%3E%3Aauth%3Cgithub%3Acosimo%3E.tar.gz

$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04

$ raku -v
Welcome to Rakudo™ v2022.02.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2022.02.

Please advise?

keys() doesn't work consistently

For some reason keys() doesn't work consistently, It's probably something to do with the way that the stats are being misused to obtain them.

flush-all does not flush the keys

use v6;
use Cache::Memcached;

my $memd = Cache::Memcached.new;
$memd.set("foobar", 42);
$memd.flush-all;
say $memd.get("foobar");

prints 42

set expiration time

Is it possible to set expiration time?
I tried $memd.set("name", "foo", 2); but I got Too many positionals passed; expected 3 arguments but got 4.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.