Code Monkey home page Code Monkey logo

Comments (5)

dcrosta avatar dcrosta commented on May 27, 2024 1

@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.

cgordon avatar cgordon commented on May 27, 2024

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.

dcrosta avatar dcrosta commented on May 27, 2024

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.

cgordon avatar cgordon commented on May 27, 2024

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.

cgordon avatar cgordon commented on May 27, 2024

@drcosta I'm going to "time out" this issue :) Let me know if you'd like to revisit it.

from pymemcache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.