Comments (5)
@cgordon I had forgotten about this, and apparently missed your last comment anyway. We added https://gist.github.com/dcrosta/9473409 to our codebase to implement this for our needs -- documenting here in case it's helpful for anyone else in the future.
from pymemcache.
The Client class was designed to be as simple as possible, and to avoid any connection policy issues, like pooling, load balancing, consistent hashing and even retry logic. My goal was to make it as easy as possible to build those things around Client. The FallbackClient class is a good example of that. The underlying principle was to keep Client as clean and performant as possible, so users of Client didn't have to pay for any functionality they didn't want. That was largely motivated by python-memcaches decision to layer in load balancing and thread locals and other things that aren't completely necessary in the core client logic.
This request falls into sort of a gray zone for me. Can you give me more background on why you want this functionality? Are you worried about overloading a memcache server with repeated connections? Do you just not want to wait for the connect_timeout during periods when you are restarting your memcache hosts?
from pymemcache.
I see, that makes sense.
We actually connect to something that speaks the memcache protocol but which is not memcache itself. We do this from very high-volume services where each call matters relatively little, so python-memcache's policy of "I'll just lie to you for 30 seconds after a disconnect" is actually OK for us.
Maybe I'll experiment with a subclass of Client
internally, and if it looks like something others might want I can submit here as another module, similar to the fallback client?
from pymemcache.
I agree with your earlier statement that this isn't a big enough feature to warrant a subclass, I just want to make sure I understand the need so that we add the right thing to Client.
Client already has ignore_exc, which will do what you want for "get" style requests (ignore exceptions and report no return result). So presumably what you're looking for is something similar for "set" style requests? What is happening in your architecture during the period in which memcache is disconnected? Are you restarting the proxy on the local hosts? Or restarting the remote memcache server connected to the proxy?
from pymemcache.
@drcosta I'm going to "time out" this issue :) Let me know if you'd like to revisit it.
from pymemcache.
Related Issues (20)
- KeyError caused by wrong key type. HOT 2
- Feature request: Support for Get and Touch HOT 1
- Usage on arm servers? Invalid magic error HOT 1
- Feature request: Pass hashed server value to get/set/delete functions (for example get_many to one hashed server) HOT 1
- Add an existing key, expects to fail but returns True HOT 1
- Intermittent MemcacheUnknownCommandError for "lru_crawler metadump all" HOT 3
- MockMemcacheClient return string as bytes HOT 2
- How to properly set the `timeout` and `connect_timeout` values? HOT 1
- Different signature/behaviour of incr, decr for Hash and Base.
- Peformance issue with get_many HOT 2
- Broken tests on i686-linux
- pip install pymemcache empty __pycache__ folder under pymemcache
- Add support for blocking pools HOT 2
- Delete key from every node HOT 9
- Would it be feasible to provide asyncio compatible client? HOT 1
- Feature Request [Elasticache-Auto-Discovery] HOT 3
- Python hangs when calling flush_all and doing add or set operation with multiprocess. HOT 2
- Can't pickle local object 'monta_cardapio_por_secao.<locals>.<lambda>' HOT 2
- AttributeError: 'HashClient' object has no attribute 'stats' HOT 1
- pymemcache.exceptions.MemcacheUnknownCommandError: b'get' when hitting maximum number of connections HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pymemcache.