{"id":15626268,"url":"https://github.com/arthurnn/memcached","last_synced_at":"2025-04-04T08:09:13.489Z","repository":{"id":405738,"uuid":"24449","full_name":"arthurnn/memcached","owner":"arthurnn","description":"A Ruby interface to the libmemcached C client","archived":false,"fork":false,"pushed_at":"2024-03-09T00:12:10.000Z","size":15149,"stargazers_count":433,"open_issues_count":16,"forks_count":127,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-28T07:08:13.048Z","etag":null,"topics":["memcached","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"afl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arthurnn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2008-06-11T20:40:22.000Z","updated_at":"2025-02-28T17:05:58.000Z","dependencies_parsed_at":"2023-02-12T07:31:41.658Z","dependency_job_id":"f8e16925-7157-42c9-9c2b-4888917d8cc8","html_url":"https://github.com/arthurnn/memcached","commit_stats":{"total_commits":1149,"total_committers":67,"mean_commits":"17.149253731343283","dds":0.6753698868581375,"last_synced_commit":"f19f1329657cc3ecac633e71a6eed2c8a04dba56"},"previous_names":["evan/memcached"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurnn%2Fmemcached","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurnn%2Fmemcached/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurnn%2Fmemcached/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurnn%2Fmemcached/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arthurnn","download_url":"https://codeload.github.com/arthurnn/memcached/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247142074,"owners_count":20890653,"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","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":["memcached","ruby"],"created_at":"2024-10-03T10:11:48.666Z","updated_at":"2025-04-04T08:09:13.464Z","avatar_url":"https://github.com/arthurnn.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# memcached\n\nAn interface to the libmemcached C client.\n[![Build Status](https://github.com/arthurnn/memcached/workflows/CI/badge.svg?branch=master)](https://github.com/arthurnn/memcached/actions?query=branch%3Amaster)\n\n## License\n\nCopyright 2009-2013 Cloudburst, LLC. Licensed under the AFL 3. See the\nincluded LICENSE file. Portions copyright 2007-2009 TangentOrg, Brian Aker,\nlicensed under the BSD license, and used with permission.\n\n## Features\n\n*   clean API\n*   robust access to all memcached features\n*   SASL support for the binary protocol\n*   multiple hashing modes, including consistent hashing\n*   ludicrous speed, including optional pipelined IO with no_reply\n\n\nThe **memcached** library wraps the pure-C libmemcached client via SWIG.\n\n## Installation\n\nYou need Ruby 1.8.7 or Ruby 1.9.2. Other versions may work, but are not\nguaranteed. You also need the `libsasl2-dev` and `gettext` libraries, which\nshould be provided through your system's package manager.\n\nInstall the gem:\n    sudo gem install memcached --no-rdoc --no-ri\n\n## Usage\n\nStart a local networked memcached server:\n    $ memcached -p 11211 \u0026\n\nNow, in Ruby, require the library and instantiate a Memcached object at a\nglobal level:\n\n    require 'memcached'\n    $cache = Memcached::Client.new(\"localhost:11211\")\n\nNow you can set things and get things:\n\n    value = 'hello'\n    $cache.set 'test', value\n    $cache.get 'test' #=\u003e \"hello\"\n\nYou can set with an expiration timeout:\n\n    value = 'hello'\n    $cache.set 'test', value, 1\n    sleep(2)\n    $cache.get 'test' #=\u003e nil\n\nYou can get multiple values at once:\n\n    value = 'hello'\n    $cache.set 'test', value\n    $cache.set 'test2', value\n    $cache.get ['test', 'test2', 'missing']\n      #=\u003e {\"test\" =\u003e \"hello\", \"test2\" =\u003e \"hello\"}\n\nYou can set a counter and increment it. Note that you must initialize it with\nan integer, encoded as an unmarshalled ASCII string:\n\n    start = 1\n    $cache.set 'counter', start.to_s, 0, false\n    $cache.increment 'counter' #=\u003e 2\n    $cache.increment 'counter' #=\u003e 3\n    $cache.get('counter', false).to_i #=\u003e 3\n\nYou can get some server stats:\n\n    $cache.stats #=\u003e {..., :bytes_written=\u003e[62], :version=\u003e[\"1.2.4\"] ...}\n\n## Rails 3 and 4\n\nUse [memcached_store gem](https://github.com/Shopify/memcached_store) to\nintegrate ActiveSupport cache store and memcached gem\n\n## Pipelining\n\nPipelining updates is extremely effective in **memcached**, leading to more\nthan 25x write throughput than the default settings. Use the following options\nto enable it:\n\n    :no_block =\u003e true,\n    :buffer_requests =\u003e true,\n    :noreply =\u003e true,\n    :binary_protocol =\u003e false\n\nCurrently #append, #prepend, #set, and #delete are pipelined. Note that when\nyou perform a read, all pending writes are flushed to the servers.\n\n## Threading\n\n**memcached** is threadsafe, but each thread requires its own Memcached\ninstance. Create a global Memcached, and then call Memcached#clone each time\nyou spawn a thread.\n\n    thread = Thread.new do\n      cache = $cache.clone\n      # Perform operations on cache, not $cache\n      cache.set 'example', 1\n      cache.get 'example'\n    end\n\n    # Join the thread so that exceptions don't get lost\n    thread.join\n\n## Legacy applications\n\nThere is a compatibility wrapper for legacy applications called\nMemcached::Rails.\n\n## Benchmarks\n\n**memcached**, correctly configured, is at least twice as fast as\n**memcache-client** and **dalli**. See link:BENCHMARKS for details.\n\n## Reporting problems\n\nThe support forum is [here](http://github.com/arthurnn/memcached/issues).\n\nPatches and contributions are very welcome. Please note that contributors are\nrequired to assign copyright for their additions to Cloudburst, LLC.\n\n## Further resources\n\n*   [Memcached wiki](https://github.com/memcached/memcached/wiki)\n*   [Libmemcached homepage](http://libmemcached.org)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurnn%2Fmemcached","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthurnn%2Fmemcached","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurnn%2Fmemcached/lists"}