Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to exit gracefully in synchronous mode #23

Closed
wcy168 opened this issue Aug 22, 2022 · 2 comments
Closed

How to exit gracefully in synchronous mode #23

wcy168 opened this issue Aug 22, 2022 · 2 comments

Comments

@wcy168
Copy link

wcy168 commented Aug 22, 2022

How to exit gracefully in synchronous mode

@mzimbres
Copy link
Collaborator

The correct way is to

  1. Set connection::config::enable_reconnect = false (if not already set)
  2. Send a QUIT command.

This will cause sync::run() to return. Otherwise, you may have an io_context::run() that is not returning, in this case you have to stop giving him further work, in extreme cases you can also call io_context::stop(). For an example see https://github.com/mzimbres/aedis/blob/master/examples/intro_sync.cpp.

Notice Aedis 1.0.0 was release yesterday and all synchronous functions are now part of the sync class. There were also a fixe of a bug that prevented proper reconnection. See the changelog for more info https://mzimbres.github.io/aedis/md_CHANGELOG.html

@wcy168
Copy link
Author

wcy168 commented Aug 23, 2022

ok,thank you

@wcy168 wcy168 closed this as completed Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants