Bugfix: Proper async_call
error/exception handling
#65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
QRateLimitedExecutor wrapping functions like
RateLimitedCommRqData
,RateLimitedCommKwRqData
,RateLimitedSendOrder
,RateLimitedSendCondition
returnconcurrent.futures.Future
object immediately upon asynchronous execution withasync_call
.Therefore, the result after execution should be returned by attaching callback functions 1, 2 to the Future object. However, the callback implementation contained in
try_or_raise
currently does not have a way to properly handle an error or an exception in the function return.For example, if an error or exception occurs between immediately after the execution of a function and before the event begins to return, there is no way on the server side to notify the client that there is an error, and the client will continue to wait for the next message. I found this attempt, but this is an invalid exception handling method for
async_call
returning a Future object.In this pull request, the
except_callback
argument to receive the exception object when an error or exception occurs was added totry_or_raise
, and I tried to find a place where it can be used and apply it all.