{"id":22546608,"url":"https://github.com/prx/redix-clustered","last_synced_at":"2025-04-10T00:52:41.213Z","repository":{"id":57542456,"uuid":"414280221","full_name":"PRX/redix-clustered","owner":"PRX","description":"Hex package to run redix + clustered + pooling + etc","archived":false,"fork":false,"pushed_at":"2024-06-06T14:18:23.000Z","size":64,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-10T00:52:33.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/PRX.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":"2021-10-06T16:03:02.000Z","updated_at":"2024-09-04T21:29:12.000Z","dependencies_parsed_at":"2022-09-26T18:31:14.684Z","dependency_job_id":null,"html_url":"https://github.com/PRX/redix-clustered","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRX%2Fredix-clustered","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRX%2Fredix-clustered/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRX%2Fredix-clustered/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRX%2Fredix-clustered/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PRX","download_url":"https://codeload.github.com/PRX/redix-clustered/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137995,"owners_count":21053775,"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":[],"created_at":"2024-12-07T15:08:20.372Z","updated_at":"2025-04-10T00:52:41.190Z","avatar_url":"https://github.com/PRX.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RedixClustered\n\nCluster support for Redix, and other stuff! Currently:\n\n1. Very WIP\n2. Needs documentation\n3. The pipelines aren't smart enough to deal with keys on different nodes\n\nPorted from some other PRX applications, and working to improve.\n\n## Installation\n\nAdd `redix_clustered` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:redix_clustered, \"~\u003e 1.0.0\"}\n  ]\nend\n```\n\nThen just add your cluster as a child of your application:\n\n```elixir\nchildren = [\n  {RedixClustered, host: \"127.0.0.1\", port: 6379, namespace: \"my-ns\"}\n]\n```\n\nOptions you can pass to the RedixClustered spec:\n\n- `host` the hostname or IP of your redis cluster (default `\"127.0.0.1\"`)\n- `port` the port of your redis cluster (default `6379`)\n- `username` passed to Redix\n- `password` passed to Redix\n- `timeout` passed to Redix\n- `name` optional name used to access your cluster, and also the supervision [:name](https://hexdocs.pm/elixir/1.12/Supervisor.html#start_link/2)\n- `namespace` optional prefix to add to your redis keys\n- `pool_size` the number of Redix connections to establish per node (default `1`)\n- `request_opts` optional Keyword list of options to pass to each `Redix.command` / `Redix.pipeline` call\n\nAnd then you can run commands/pipelines:\n\n```elixir\n{:ok, _pid} = RedixClustered.start_link()\n{:ok, _pid} = RedixClustered.start_link(name: :red2, namespace: \"ns2\")\n\nRedixClustered.command([\"set\", \"foo\", \"val1\"])\n# {:ok, \"OK\"}\n\nRedixClustered.command(:red2, [\"set\", \"foo\", \"val2\"])\n# {:ok, \"OK\"}\n\nRedixClustered.command([\"get\", \"foo\"])\n# {:ok, \"val1\"}\n\nRedixClustered.command(:red2, [\"get\", \"foo\"])\n# {:ok, \"val2\"}\n\nRedixClustered.command(:red2, [\"get\", \"ns2:foo\"], namespace: false)\n# {:ok, \"val2\"}\n```\n\nOr if you want to clone set commands to a 2nd redis cluster:\n\n```elixir\nclone = [host: \"127.0.0.2\", port: 6380, namespace: \"ns2\"]\n\nchildren = [\n  {RedixClustered, host: \"127.0.0.1\", namespace: \"ns1\", clone: clone}\n]\n```\n\n## License\n\n[MIT License](LICENSE)\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprx%2Fredix-clustered","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprx%2Fredix-clustered","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprx%2Fredix-clustered/lists"}