Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7977981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:21:47+00:00 2026-06-04T09:21:47+00:00

The API I’m using, spymemcached, basically gives MemcachedClient memc = new MemCachedClient(new InetSocketAddress(host, port));

  • 0

The API I’m using, spymemcached, basically gives

MemcachedClient memc = new MemCachedClient(new InetSocketAddress("host", port));

It doesn’t really give me a connect() or isConnected() function. The API offers a DefaultConnectionFactory but at first look at the code it doesn’t look like it manages a connection pool. Does anyone know how to do this in spymemcached or in another Java memcached library?

More generally – what’s the most “moral” way to make my application tolerant against loss of connection?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:21:49+00:00Added an answer on June 4, 2026 at 9:21 am

    When you call the MemcachedClient constructor it automatically connects to your memcached server. There is no connect() or isConnected() method. If you lose the connection with Spymemcached it will try to reconnect for you. Also, the DefaultConnectionFactory is meant to be used to specify special connection attributes (e.g. hashing method and failure mode). If you want to use a connection factory then you need to use the MemcachedClient constructor that takes a ConnectionFactory and a List<InetSocketAddress>.

    Spymemcached uses a single IO thread, but acts like a multithreaded client. With one thread for example, you can do up to 50k ops per second. If you want to create a thread pool then you will have to do it in your user application.

    More generally – what’s the most “moral” way to make my application tolerant against loss of connection?

    Like I mentioned above, Spymemcached will attempt to reconnect if it loses connection to the server. This process will usually take around 17ms. Most people that use the client do however create a thread pool in their application code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

on api level 4 (android 1.6), after taking photo using: Intent intent = new
The API doesn't seem promising.
Facebook API can give the pages a user admins. Suppose that it returns me
The API doesn't show a proper example how to use connectNulls property. I had
I've converted an api written in Java into a .net dll using IKVM, and
The API gives the code as: public function up() { $this->addColumn('table_name', 'column_name', 'string', $options);
I am using gooleplaces API. I have a response in json, but the problem
The API I'm using provides a JSON payload. Part of the response has a
The API documentation gave me hopes last night with bindInfoWindowHtml. But it doesn't seem
_fullpath API of windows takes relative path and gives the corresponding absolute path. But,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.