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

  • SEARCH
  • Home
  • 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 6370697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:57:50+00:00 2026-05-25T00:57:50+00:00

I found some redis nio client. it just put the command to a queue,

  • 0

I found some redis nio client.
it just put the command to a queue,
whenever there is a response, parse the response and attach the result to the first queue element.

for example :

get(K key){
  Command cmd = new GetCommand();
  queue.put(cmd);
  send(cmd);
}
//invoked while any data receive from server
onReceive(Response res){
  queue.take().setResult(parse(res));
}

The server can guarantee the response are sent back with the same sequence as the request are sent with?

Or it just because redis server use one thread to process request? Can I use this approach in other cases?

  • 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-05-25T00:57:51+00:00Added an answer on May 25, 2026 at 12:57 am

    This will work, but you do need to be fairly careful with this sort of thing. On a single connection that sends commands in order, called from a single thread, you will get responses in order.

    If you have multiple threads accessing the same connection or use multiple connections on the same queue, matching responses to requests gets a lot more complicated.

    For the specific case of what I assume is the client you are using, I found a post that may answer your question more directly:

    Lettuce is a scalable thread-safe client built on top of the excellent
    netty framework. Multiple threads can share a single connection as
    long as they avoid blocking and transactional operations, and multiple
    connections are efficiently managed using NIO selectors.
    Internally lettuce is completely asynchronous and it exposes both
    synchronous and asynchronous interfaces, as well as asynchronous
    pub/sub callbacks.

    http://groups.google.com/group/redis-db/browse_thread/thread/fa05f025c9213ddf

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

Sidebar

Related Questions

Found some old code, circa VS 2003. Now I have just VS 2008 (SP1)
I've just found some C++ code (at http://msdn.microsoft.com/en-us/library/k8336763(VS.71).aspx ), which uses a technique I've
I found some interface for the list: and there I found this constructor template<typenameT>
I was trying to put some heavy load on my Redis for testing purposes
I found some tutorials to use the camera. There are no errors on the
I found some tutorials online that could help but I am not sure there
I found some sources online that indicate that there are tools for Octave that
i found some samples that implements remember me functionality by just <remember-me/> and other
I found some code in a project which looks like that : int main(int
I found some mapkit code on the internet that looks like this: - (void)recenterMap

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.