{"id":18387552,"url":"https://github.com/j5ik2o/reactive-memcached","last_synced_at":"2025-04-07T01:31:13.052Z","repository":{"id":40445943,"uuid":"142254919","full_name":"j5ik2o/reactive-memcached","owner":"j5ik2o","description":"Akka-Stream based Memached Client for Scala","archived":false,"fork":false,"pushed_at":"2023-12-15T02:36:19.000Z","size":472,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T10:23:13.809Z","etag":null,"topics":["akka","akka-stream","memcached","memcached-client","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/j5ik2o.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-07-25T06:06:59.000Z","updated_at":"2023-07-25T14:18:44.000Z","dependencies_parsed_at":"2024-11-06T01:52:39.748Z","dependency_job_id":"47ced6fa-fba8-42a2-91fb-eb667c28bb5a","html_url":"https://github.com/j5ik2o/reactive-memcached","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j5ik2o%2Freactive-memcached","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j5ik2o%2Freactive-memcached/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j5ik2o%2Freactive-memcached/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j5ik2o%2Freactive-memcached/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j5ik2o","download_url":"https://codeload.github.com/j5ik2o/reactive-memcached/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247577856,"owners_count":20961189,"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":["akka","akka-stream","memcached","memcached-client","scala"],"created_at":"2024-11-06T01:26:44.215Z","updated_at":"2025-04-07T01:31:12.403Z","avatar_url":"https://github.com/j5ik2o.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reactive-mecached\n\n[![CircleCI](https://circleci.com/gh/j5ik2o/reactive-memcached.svg?style=shield\u0026circle-token=77a2aba7530dd521591655901768a44d6e2e9e99)](https://circleci.com/gh/j5ik2o/reactive-memcached)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.j5ik2o/reactive-memcached-core_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.j5ik2o/reactive-memcached-core_2.12)\n[![Scaladoc](http://javadoc-badge.appspot.com/com.github.j5ik2o/reactive-memcached-core_2.12.svg?label=scaladoc)](http://javadoc-badge.appspot.com/com.github.j5ik2o/reactive-memcached-core_2.12/com/github/j5ik2o/reactive/memcached/index.html?javadocio=true)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/0f8d5414b1da449d85299daa9934c899)](https://www.codacy.com/app/j5ik2o/reactive-memached?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=j5ik2o/reactive-memached\u0026amp;utm_campaign=Badge_Grade)\n[![License: MIT](http://img.shields.io/badge/license-MIT-orange.svg)](LICENSE)\n\nAkka-Stream based Memcached Client for Scala\n\n## Concept\n\n- Transport is akka-stream 2.5.x.\n- Response parser is fastparse.\n- monix.eval.Task support.\n\n## Support Protocol\n\nhttps://github.com/memcached/memcached/blob/master/doc/protocol.txt\n\n- Supported commands\n  - \"set\", \"add\", \"replace\", \"cas\", \"delete\", \"get\", \"gets\", \"gat\", \"gats\", \"touch\", \"version\"\n- Not supported commands\n  - \"append\", \"prepend\", \"slabs reassign\", \"slabs automove\", \"lru\", \"lru_crawler\", \"watch\", \"stats\", \"STAT items\"\n  \n\n## Installation\n\nAdd the following to your sbt build (Scala 2.11.x, 2.12.x):\n\n### Release Version\n\n```scala\nresolvers += \"Sonatype OSS Release Repository\" at \"https://oss.sonatype.org/content/repositories/releases/\"\n\nlibraryDependencies += \"com.github.j5ik2o\" %% \"reactive-memcached-core\" % \"1.0.6\"\n```\n\n### Snapshot Version\n\n```scala\nresolvers += \"Sonatype OSS Snapshot Repository\" at \"https://oss.sonatype.org/content/repositories/snapshots/\"\n\nlibraryDependencies += \"com.github.j5ik2o\" %% \"reactive-memcached-core\" % \"1.0.7-SNAPSHOT\"\n```\n\n## Usage\n\n### Non connection pooling\n\n```scala\nimport monix.execution.Scheduler.Implicits.global\n\nimplicit val system = ActorSystem()\n\nval peerConfig = PeerConfig(remoteAddress = new InetSocketAddress(\"127.0.0.1\", 6379))\nval connection = MemcachedConnection(peerConfig)\nval client = MemcachedClient()\n\nval result = (for{\n  _ \u003c- client.set(\"foo\", \"bar\")\n  r \u003c- client.get(\"foo\")\n} yield r).run(connection).runAsync\n\nprintln(result) // bar\n```\n\n### Connection pooling\n\n```scala\nimport monix.execution.Scheduler.Implicits.global\n\nimplicit val system = ActorSystem()\n\nval peerConfig = PeerConfig(remoteAddress = new InetSocketAddress(\"127.0.0.1\", 6379))\nval pool = MemcachedConnectionPool.ofSingleRoundRobin(sizePerPeer = 5, peerConfig, RedisConnection(_)) // powered by RoundRobinPool\nval connection = MemcachedConnection(connectionConfig)\nval client = MemcachedClient()\n\n// Fucntion style\nval result1 = pool.withConnectionF{ con =\u003e\n  (for{\n    _ \u003c- client.set(\"foo\", \"bar\")\n    r \u003c- client.get(\"foo\")\n  } yield r).run(con) \n}.runAsync\n\nprintln(result1) // bar\n\n// Monadic style\nval result2 = (for {\n  _ \u003c- ConnectionAutoClose(pool)(client.set(\"foo\", \"bar\").run)\n  r \u003c- ConnectionAutoClose(pool)(client.get(\"foo\").run)\n} yield r).run().runAsync\n\nprintln(result2) // bar\n```\n\nif you want to use other pooling implementation, please select from the following modules.\n\n- reactive-memcached-pool-commons (commons-pool2)\n- reactive-memcached-pool-scala (scala-pool)\n- reactive-memcached-pool-fop (fast-object-pool)\n- reactive-memcached-pool-stormpot (stormpot)\n\n### Hash ring connection\n\n```scala\nimport monix.execution.Scheduler.Implicits.global\n\nimplicit val system = ActorSystem()\n\nval peerConfigs = Seq(\n  PeerConfig(remoteAddress = new InetSocketAddress(\"127.0.0.1\", 6380)),\n  PeerConfig(remoteAddress = new InetSocketAddress(\"127.0.0.1\", 6381)),\n  PeerConfig(remoteAddress = new InetSocketAddress(\"127.0.0.1\", 6382))\n)\n\nval connection = HashRingConnection(peerConfigs)\n\nval client = MemcachedClient()\n\nval result = (for{\n  _ \u003c- client.set(\"foo\", \"bar\") // write to master\n  r \u003c- client.get(\"foo\")        // read from any slave\n} yield r).run(connection).runAsync\n\nprintln(result) // bar\n```\n\n## License\n\nMIT License / Copyright (c) 2018 Junichi Kato\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj5ik2o%2Freactive-memcached","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj5ik2o%2Freactive-memcached","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj5ik2o%2Freactive-memcached/lists"}