{"id":30211329,"url":"https://github.com/mons/anyevent-memcached","last_synced_at":"2025-08-13T20:36:12.621Z","repository":{"id":728398,"uuid":"376951","full_name":"Mons/AnyEvent-Memcached","owner":"Mons","description":"AnyEvent memcached client","archived":false,"fork":false,"pushed_at":"2016-11-30T11:04:16.000Z","size":488,"stargazers_count":8,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-10T20:33:07.488Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://search.cpan.org/dist/AnyEvent-Memcached","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mons.png","metadata":{"files":{"readme":"README","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-11-18T08:52:16.000Z","updated_at":"2019-08-13T14:29:19.000Z","dependencies_parsed_at":"2022-07-18T12:19:07.937Z","dependency_job_id":null,"html_url":"https://github.com/Mons/AnyEvent-Memcached","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/Mons/AnyEvent-Memcached","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FAnyEvent-Memcached","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FAnyEvent-Memcached/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FAnyEvent-Memcached/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FAnyEvent-Memcached/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mons","download_url":"https://codeload.github.com/Mons/AnyEvent-Memcached/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FAnyEvent-Memcached/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270305902,"owners_count":24562115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-13T20:34:34.289Z","updated_at":"2025-08-13T20:36:12.582Z","avatar_url":"https://github.com/Mons.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n    AnyEvent::Memcached - AnyEvent memcached client\n\nSYNOPSIS\n        use AnyEvent::Memcached;\n\n        my $memd = AnyEvent::Memcached-\u003enew(\n        servers =\u003e [ \"10.0.0.15:11211\", \"10.0.0.15:11212\" ], # same as in Cache::Memcached\n        debug   =\u003e 1,\n        compress_threshold =\u003e 10000,\n        namespace =\u003e 'my-namespace:',\n\n        # May use another hashing algo:\n        hasher  =\u003e 'AnyEvent::Memcached::Hash::WithNext',\n\n        cv      =\u003e $cv, # AnyEvent-\u003econdvar: group callback\n        );\n\n        $memd-\u003eset_servers([ \"10.0.0.15:11211\", \"10.0.0.15:11212\" ]);\n\n        # Basic methods are like in Cache::Memcached, but with additional cb =\u003e sub { ... };\n        # first argument to cb is return value, second is the error(s)\n\n        $memd-\u003eset( key =\u003e $value, cb =\u003e sub {\n        shift or warn \"Set failed: @_\"\n        } );\n\n        # Single get\n        $memd-\u003eget( 'key', cb =\u003e sub {\n        my ($value,$err) = shift;\n        $err and return warn \"Get failed: @_\";\n        warn \"Value for key is $value\";\n        } );\n\n        # Multi-get\n        $memd-\u003eget( [ 'key1', 'key2' ], cb =\u003e sub {\n        my ($values,$err) = shift;\n        $err and return warn \"Get failed: @_\";\n        warn \"Value for key1 is $values-\u003e{key1} and value for key2 is $values-\u003e{key2}\"\n        } );\n\n        # Additionally there is rget (see memcachedb-1.2.1-beta)\n\n        $memd-\u003erget( 'fromkey', 'tokey', cb =\u003e sub {\n        my ($values,$err) = shift;\n        $err and warn \"Get failed: @_\";\n        while (my ($key,$value) = each %$values) {\n            # ...\n        }\n        } );\n\n        # Rget with sorted responce values\n        $memd-\u003erget( 'fromkey', 'tokey', rv =\u003e 'array' cb =\u003e sub {\n        my ($values,$err) = shift;\n        $err and warn \"Get failed: @_\";\n        for (0 .. $#values/2) {\n            my ($key,$value) = @$values[$_*2,$_*2+1];\n        }\n        } );\n\nDESCRIPTION\n    Asyncronous \"memcached/memcachedb\" client for AnyEvent framework\n\nNOTICE\n    There is a notices in Cache::Memcached::AnyEvent related to this module.\n    They all has been fixed\n\n    Prerequisites\n        We no longer need Object::Event and Devel::Leak::Cb. At all, the\n        dependency list is like in Cache::Memcached + AnyEvent\n\n    Binary protocol\n        It seems to me, that usage of binary protocol from pure perl gives\n        very little advantage. So for now I don't implement it\n\n    Unimplemented Methods\n        There is a note, that get_multi is not implementeted. In fact, it\n        was implemented by method \"get\", but the documentation was wrong.\n\n    In general, this module follows the spirit of AnyEvent rather than\n    correspondence to Cache::Memcached interface.\n\nMETHODS\n  new %args\n    Currently supported options:\n\n    servers =item namespace =item debug =item cv =item compress_threshold\n    =item compress_enable =item timeout =item hasher\n        If set, will use instance of this class for hashing instead of\n        default. For implementing your own hashing, see sources of\n        AnyEvent::Memcached::Hash and AnyEvent::Memcached::Hash::With::Next\n\n    noreply\n        If true, additional connection will established for noreply\n        commands.\n\n    cas If true, will enable cas/gets commands (since they are not suppotred\n        in memcachedb)\n\n  set_servers\n        Setup server list\n\n  connect\n        Establish connection to all servers and invoke event C\u003cconnected\u003e, when ready\n\n  set( $key, $value, [cv =\u003e $cv], [ expire =\u003e $expire ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Unconditionally sets a key to a given value in the memcache.\n\n    $rc is\n\n    '1' Successfully stored\n\n    '0' Item was not stored\n\n    undef\n        Error happens, see $err\n\n  cas( $key, $cas, $value, [cv =\u003e $cv], [ expire =\u003e $expire ], cb =\u003e $cb-\u003e( $rc, $err ) )\n        $memd-\u003egets($key, cb =\u003e sub {\n        my $value = shift;\n        unless (@_) { # No errors\n            my ($cas,$val) = @$value;\n            # Change your value in $val\n            $memd-\u003ecas( $key, $cas, $value, cb =\u003e sub {\n            my $rc = shift;\n            if ($rc) {\n                # stored\n            } else {\n                # ...\n            }\n            });\n        }\n        })\n\n    $rc is the same, as for \"set\"\n\n    Store the $value on the server under the $key, but only if CAS value\n    associated with this key is equal to $cas. See also \"gets\"\n\n  add( $key, $value, [cv =\u003e $cv], [ expire =\u003e $expire ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Like \"set\", but only stores in memcache if the key doesn't already\n    exist.\n\n  replace( $key, $value, [cv =\u003e $cv], [ expire =\u003e $expire ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Like \"set\", but only stores in memcache if the key already exists. The\n    opposite of add.\n\n  append( $key, $value, [cv =\u003e $cv], [ expire =\u003e $expire ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Append the $value to the current value on the server under the $key.\n\n    append command first appeared in memcached 1.2.4.\n\n  prepend( $key, $value, [cv =\u003e $cv], [ expire =\u003e $expire ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Prepend the $value to the current value on the server under the $key.\n\n    prepend command first appeared in memcached 1.2.4.\n\n  get( $key, [cv =\u003e $cv], [ expire =\u003e $expire ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Retrieve the value for a $key. $key should be a scalar\n\n  get( $keys : ARRAYREF, [cv =\u003e $cv], [ expire =\u003e $expire ], cb =\u003e $cb-\u003e( $values_hash, $err ) )\n    Retrieve the values for a $keys. Return a hash with keys/values\n\n  gets( $key, [cv =\u003e $cv], [ expire =\u003e $expire ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Retrieve the value and its CAS for a $key. $key should be a scalar.\n\n    $rc is a reference to an array [$cas, $value], or nothing for\n    non-existent key\n\n  gets( $keys : ARRAYREF, [cv =\u003e $cv], [ expire =\u003e $expire ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Retrieve the values and their CAS for a $keys.\n\n    $rc is a hash reference with $rc-\u003e{$key} is a reference to an array\n    [$cas, $value]\n\n  delete( $key, [cv =\u003e $cv], [ noreply =\u003e 1 ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Delete $key and its value from the cache.\n\n    If \"noreply\" is true, cb doesn't required\n\n  del\n    Alias for \"delete\"\n\n  remove\n    Alias for \"delete\"\n\n  incr( $key, $increment, [cv =\u003e $cv], [ noreply =\u003e 1 ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Increment the value for the $key by $delta. Starting with memcached\n    1.3.3 $key should be set to a number or the command will fail. Note that\n    the server doesn't check for overflow.\n\n    If \"noreply\" is true, cb doesn't required, and if passed, simply called\n    with rc = 1\n\n    Similar to DBI, zero is returned as \"0E0\", and evaluates to true in a\n    boolean context.\n\n  decr( $key, $decrement, [cv =\u003e $cv], [ noreply =\u003e 1 ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Opposite to \"incr\"\n\n  rget( $from, $till, [ max =\u003e 100 ], [ '+left' =\u003e 1 ], [ '+right' =\u003e 1 ], [cv =\u003e $cv], [ rv =\u003e 'array' ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Memcachedb 1.2.1-beta implements rget method, that allows to look\n    through the whole storage\n\n    $from\n        the starting key\n\n    $till\n        finishing key\n\n    +left\n        If true, then starting key will be included in results. true by\n        default\n\n    +right\n        If true, then finishing key will be included in results. true by\n        default\n\n    max Maximum number of results to fetch. 100 is the maximum and is the\n        default\n\n    rv  If passed rv =\u003e 'array', then the return value will be arrayref with\n        values in order, returned by memcachedb.\n\n  incadd ( $key, $increment, [cv =\u003e $cv], [ noreply =\u003e 1 ], cb =\u003e $cb-\u003e( $rc, $err ) )\n    Increment key, and if it not exists, add it with initial value. If add\n    fails, try again to incr or fail\n\n  destroy\n    Shutdown object as much, as possible, incl cleaning of incapsulated\n    objects\n\nBUGS\n    Feature requests are welcome\n\n    Bug reports are welcome\n\nAUTHOR\n    Mons Anderson, \"\u003cmons at cpan.org\u003e\"\n\nCOPYRIGHT \u0026 LICENSE\n    Copyright 2009 Mons Anderson, all rights reserved.\n\n    This program is free software; you can redistribute it and/or modify it\n    under the same terms as Perl itself.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmons%2Fanyevent-memcached","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmons%2Fanyevent-memcached","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmons%2Fanyevent-memcached/lists"}