{"id":15062829,"url":"https://github.com/lerouxrgd/celtuce","last_synced_at":"2025-10-04T22:31:31.367Z","repository":{"id":48095276,"uuid":"65210013","full_name":"lerouxrgd/celtuce","owner":"lerouxrgd","description":"Clojure wrappers for Lettuce (Java Redis client) ","archived":true,"fork":false,"pushed_at":"2021-08-07T00:55:24.000Z","size":183,"stargazers_count":50,"open_issues_count":6,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-29T21:18:06.955Z","etag":null,"topics":["clojure","lettuce","redis"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lerouxrgd.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}},"created_at":"2016-08-08T14:15:19.000Z","updated_at":"2024-05-31T07:53:46.000Z","dependencies_parsed_at":"2022-08-12T18:31:22.131Z","dependency_job_id":null,"html_url":"https://github.com/lerouxrgd/celtuce","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Fceltuce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Fceltuce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Fceltuce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerouxrgd%2Fceltuce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lerouxrgd","download_url":"https://codeload.github.com/lerouxrgd/celtuce/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235321032,"owners_count":18971231,"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":["clojure","lettuce","redis"],"created_at":"2024-09-24T23:47:09.297Z","updated_at":"2025-10-04T22:31:26.031Z","avatar_url":"https://github.com/lerouxrgd.png","language":"Clojure","funding_links":[],"categories":["Redis"],"sub_categories":[],"readme":"# celtuce\n\nAn idiomatic Clojure Redis client wrapping the Java client [Lettuce][].\n\n## Usage\n\n [![Clojars Project](https://img.shields.io/clojars/v/celtuce.svg)](https://clojars.org/celtuce) to include all [modules][].\n\nOr pick up only the ones you need:\n\n* [celtuce-core][]: Main module with all the core functionalities (required)\n\n  [![Clojars Project](https://img.shields.io/clojars/v/celtuce-core.svg)](https://clojars.org/celtuce-core)\n  [![cljdoc badge](https://cljdoc.org/badge/celtuce-core/celtuce-core)](https://cljdoc.org/d/celtuce-core/celtuce-core/CURRENT)\n\n* [celtuce-pool][]: Provides pooling for connections\n\n  [![Clojars Project](https://img.shields.io/clojars/v/celtuce-pool.svg)](https://clojars.org/celtuce-pool)\n  [![cljdoc badge](https://cljdoc.org/badge/celtuce-pool/celtuce-pool)](https://cljdoc.org/d/celtuce-pool/celtuce-pool/CURRENT)\n\n* [celtuce-manifold][]: Implementation of asynchronous commands based on [Manifold][]\n\n  [![Clojars Project](https://img.shields.io/clojars/v/celtuce-manifold.svg)](https://clojars.org/celtuce-manifold)\n  [![cljdoc badge](https://cljdoc.org/badge/celtuce-manifold/celtuce-manifold)](https://cljdoc.org/d/celtuce-manifold/celtuce-manifold/CURRENT)\n\n### Redis Connectors\n\nConnectors are available for both Redis `Server` and `Cluster`.\nThey are defined in `celtuce.connector` namespace of `celtuce-core` module.\n\n```clj\n(require '[celtuce.connector :as conn])\n\n(conn/redis-server \"redis://localhost:6379\")\n\n(conn/redis-cluster \"redis://localhost:30001\")\n```\n\nRedis URI synthax details can be found in [Lettuce Wiki][wiki-uri].\n\nSerialization defaults to [Nippy][], but other serializers are available in `celtuce.codec`.\nEspecially [Lettuce][] original `String` serializer can be used as follows:\n\n```clj\n(conn/redis-server\n  \"redis://localhost:6379\"\n  :codec (celtuce.codec/utf8-string-codec))\n```\n\nOther connector options:\n\n* `:conn-options` a map of connection options\n  * `:timeout` timeout for executing commands\n  * `:unit` corresponding `TimeUnit` in keyword (i.e. `:milliseconds`, etc)\n  * `:auto-flush` automatically flush commands on the underlying Netty connection\n\n* `:client-options`: a map of client options\n  * [Client-options][] available in Lettuce, with their names keywordized\n\nNote that you can find options default values in the [tests][tests-connector].\n\n### Redis Commands\n\nAll Redis [commands][] are implemented using protocols in `celtuce.commands` namespace of `celtuce-core` module.\n\n```clj\n(require '[celtuce.commands :as redis])\n```\n\n**Sync Commands**\n\n```clj\n(def connector (conn/redis-server \"redis://localhost:6379\"))\n(def cmds (conn/commands-sync connector))\n\n(redis/set cmds :foo \"bar\")\n(redis/get cmds :foo)\n\n(conn/shutdown connector)\n```\n\n**PubSub Commands**\n\nRedis prevents publishing and subscribing on the same connection.\nThe following contrive example demonstrates pubsub usage with two connections.\n\n```clj\n;; note that conn/as-pubsub also works on cluster connectors\n(def conn-pub (conn/as-pubsub (conn/redis-server \"redis://localhost:6379\")))\n(def conn-sub (conn/as-pubsub (conn/redis-server \"redis://localhost:6379\")))\n\n(def pub (conn/commands-sync conn-pub))\n(def sub (conn/commands-sync conn-sub))\n\n(conn/add-listener! \n conn-sub\n (reify redis/PubSubListener\n   (message [_ channel message]\n     (println \"received message\" message \"from channel\" channel))\n   (message [_ pattern channel message])\n   (subscribed [_ channel count]\n     (println \"new subscriber !\"))\n   (unsubscribed [_ channel count]\n     (println \"a subscriber left...\"))\n   (psubscribed [_ pattern count])\n   (punsubscribed [_ pattern count])))\n\n(redis/subscribe sub \"foo-chan\")\n(redis/publish pub \"foo-chan\" \"bar-msg\")\n(redis/unsubscribe sub \"foo-chan\")\n\n(conn/shutdown conn-pub)\n(conn/shutdown conn-sub)\n```\n\n**Dynamic Commands**\n\nStarting from Lettuce 5 it is now possible to define commands [dynamically][dynamic] by extending a `Commands` interface.\nSuch commands are obtained as follows.\n\n```clj\n(conn/commands-dynamic connector some.interface.extending.Commands)\n```\n\nYou can find basic examples in the tests.\n\n## Tests\n\nTo run unit tests you need to have both a redis server running on a `localhost:6379`,\nand a redis cluster running on `localhost:30001`.\n\nThen build artifacts and run tests:\n\n```sh\n(cd modules/celtuce-core/; lein do clean, install)\n(cd modules/celtuce-pool/; lein do clean, install)\n(cd modules/celtuce-manifold/; lein do clean, install)\n\nlein test\n```\n\n## License\n\n* [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\n[lettuce]: https://github.com/lettuce-io/lettuce-core\n[wiki-uri]: https://github.com/lettuce-io/lettuce-core/wiki/Redis-URI-and-connection-details#uri-syntax\n[client-options]: https://github.com/lettuce-io/lettuce-core/wiki/Client-options\n[dynamic]: https://github.com/lettuce-io/lettuce-core/wiki/Redis-Command-Interfaces\n\n[modules]: https://github.com/lerouxrgd/celtuce/tree/master/modules\n[commands]: https://github.com/lerouxrgd/celtuce/blob/master/modules/celtuce-core/src/celtuce/commands.clj\n[celtuce-core]: https://github.com/lerouxrgd/celtuce/tree/master/modules/celtuce-core\n[celtuce-pool]: https://github.com/lerouxrgd/celtuce/tree/master/modules/celtuce-pool\n[celtuce-manifold]: https://github.com/lerouxrgd/celtuce/tree/master/modules/celtuce-manifold\n[tests-connector]: https://github.com/lerouxrgd/celtuce/blob/master/test/celtuce/connector_test.clj\n\n[nippy]: https://github.com/ptaoussanis/nippy\n[manifold]: https://github.com/ztellman/manifold\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flerouxrgd%2Fceltuce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flerouxrgd%2Fceltuce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flerouxrgd%2Fceltuce/lists"}