Skip to content

Question about boost::redis::request::config #181

Closed
@redboltz

Description

@redboltz

boost::redis::request::config has four member variables.
I want to know the behavior of cancel or not cancel.

I assume that redis server is running, and async_run() is called with reconnect_wait_interval 10 seconds.

Case1: async_exec during disconnected

  1. restart redis server by systemctl. (server restarts immediately)
  2. User calls asnyc_exec
  3. 10 seconds later from step1 Boost.Redis reconnect to the server
  4. CompletionHandler of step2 is invoked if cancel_if_not_connected is false, otherwise the request step2 is cancelled.

I tested it by my enviromnent, and works as above. It is expected behavior for me.

Case2: disconnect after async_exec called but not completion handler is invoked.

  1. User calls asnyc_exec
  2. restart redis server by systemctl. (server restarts immediately)
  3. 10 seconds later from step2 Boost.Redis reconnect to the server
  4. ???

I am looking for the way that Boost.Redis resends step1 request to the server and receives the response and then, invoke the completion handler of the step1. So the user doesn't need to care about disconnection/resending.

I guess that boost::redis::request::config member cancel_if_unresponded and cancel_on_connection_lost are related.

If I set cancel_on_connection_lost = false, Does Boost.Redis resend the request of step1 automatically ?

Additional question: Is cancel_if_unresponded related to the situation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions