-
Notifications
You must be signed in to change notification settings - Fork 102
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
Async Implementation #31
Comments
Yes, only the synchronous method is currently available. I intend to add the asynchronous support because I also need it. Before that I have few defects to fix and to finish some IMAP stuff. |
Hi, does this is in the plan? |
What type do you like? coroutine? callback? |
I am starting to analyze how to do it (asynchronous methods). Still, I cannot give the precise schedule, due to bugs that are meant to be resolved in the meantime. But definitely, that is the next feature to be added. |
Here is a sample utility class that can help you get inspired with the smtp dialog. It demonstrates how do do custom errors for the async api, as well as how to do timeouts. (I wrote it in notepad so I haven't checked if it works)
Custom error like boost does it:
Decorator that wraps a socket or ssl socket that provides interface for sending and receiving SMTP messages with timeout support. The idea is that you start both a timer and an async_read. if timer finishes first, you close the socket, raise a flag that timer finished first and call the completion callback with error. if the read finishes first, it will schedule another read if it's muli-reply, or if it is the last reply it will cancel the timeout timer and increase the currentOperationId, such that even if timer completes, it will realize that the read already succeded and won't close the socket
Sample implementation for async_receive with timeouts and parsing for multiple replies
|
I am wondering if an async api will be provided.
Initially I thought it was supported because I saw a connect_async() but then I realized that is just a synchronous method with timeout support.
We would like to use this library because we liked the decoupled design but we need to use an async api for email sending
The text was updated successfully, but these errors were encountered: