{"action":"created","issue":{"url":"https://api.github.com/repos/pinterest/pymemcache/issues/59","labels_url":"https://api.github.com/repos/pinterest/pymemcache/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/pinterest/pymemcache/issues/59/comments","events_url":"https://api.github.com/repos/pinterest/pymemcache/issues/59/events","html_url":"https://github.com/pinterest/pymemcache/pull/59","id":89814135,"number":59,"title":"Add hashing client","user":{"login":"sontek","id":151924,"avatar_url":"https://avatars.githubusercontent.com/u/151924?v=3","gravatar_id":"","url":"https://api.github.com/users/sontek","html_url":"https://github.com/sontek","followers_url":"https://api.github.com/users/sontek/followers","following_url":"https://api.github.com/users/sontek/following{/other_user}","gists_url":"https://api.github.com/users/sontek/gists{/gist_id}","starred_url":"https://api.github.com/users/sontek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sontek/subscriptions","organizations_url":"https://api.github.com/users/sontek/orgs","repos_url":"https://api.github.com/users/sontek/repos","events_url":"https://api.github.com/users/sontek/events{/privacy}","received_events_url":"https://api.github.com/users/sontek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-06-20T20:25:13Z","updated_at":"2015-07-02T16:16:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pinterest/pymemcache/pulls/59","html_url":"https://github.com/pinterest/pymemcache/pull/59","diff_url":"https://github.com/pinterest/pymemcache/pull/59.diff","patch_url":"https://github.com/pinterest/pymemcache/pull/59.patch"},"body":"This is the beginning of how I would expect the hashing client to work.  It is built off of https://github.com/pinterest/pymemcache/pull/51 so that would need to be merged first.\r\n\r\nIt is an alternative to #44 and a fix for #52 \r\n\r\nThings left to do:\r\n\r\n- [x] Implement all client functions (set_many, get_many, incr, etc)\r\n- [x] Implement failover detection if a client is detected as down\r\n- [x] Write Integration Tests\r\n- [x] Write Unit tests\r\n- [x] Add proper logging\r\n- [ ] Write detailed documentation\r\n\r\nThis isn't ready for a merge yet but I wanted to open the PR early so we could have a conversation about it.\r\n\r\nFor failover support `HashClient` will support the following settings:\r\n\r\n`retry_attempts` - After retry_attempts has been hit it will mark the server as dead and remove it from the rotation.\r\n`retry_timeout` - It will wait this long in between retries\r\n`dead_timeout` - After `retry_attempts` have been reached it will wait this long before attempting to add the server back into the pool.\r\n\r\nOnce a server is marked dead the keys that were allocated to it will be rebalanced across the nodes that are still up.\r\n\r\nYou can use this like this:\r\n\r\n```python\r\n\r\nfrom pymemcache.client.hash import HashClient\r\nimport time\r\n\r\nclient = HashClient([\r\n    ('127.0.0.1', 11211),\r\n    ('127.0.0.1', 11212)\r\n])\r\n\r\nwhile True:\r\n    for key in ['foo', 'bar', 'baz']:\r\n        client.set(key, 'bar')\r\n        result = client.get(key)\r\n        print(result)\r\n    time.sleep(1)\r\n```"},"comment":{"url":"https://api.github.com/repos/pinterest/pymemcache/issues/comments/118082059","html_url":"https://github.com/pinterest/pymemcache/pull/59#issuecomment-118082059","issue_url":"https://api.github.com/repos/pinterest/pymemcache/issues/59","id":118082059,"user":{"login":"sontek","id":151924,"avatar_url":"https://avatars.githubusercontent.com/u/151924?v=3","gravatar_id":"","url":"https://api.github.com/users/sontek","html_url":"https://github.com/sontek","followers_url":"https://api.github.com/users/sontek/followers","following_url":"https://api.github.com/users/sontek/following{/other_user}","gists_url":"https://api.github.com/users/sontek/gists{/gist_id}","starred_url":"https://api.github.com/users/sontek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sontek/subscriptions","organizations_url":"https://api.github.com/users/sontek/orgs","repos_url":"https://api.github.com/users/sontek/repos","events_url":"https://api.github.com/users/sontek/events{/privacy}","received_events_url":"https://api.github.com/users/sontek/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T16:16:22Z","updated_at":"2015-07-02T16:16:22Z","body":"@cgordon The big question I have about this is if the murmur3/clandestined hash client should be the default.  clandestined uses `murmur3` C extension for performance, which makes this client no longer pure python.\r\n\r\nWhat I think might be better is provide a less efficient/less consistent default using CRC32 which is pure python and provide an extras (client.ext.murmur3) that can be used like:\r\n\r\n`pip install pymemcache[murmur3]` and then they will get the better client.  What do you think?  Is it fine to depend on the C extension in clandestined or should we make it optional?"}}