Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED] Reduce use of new timer for publish calls
Use a long-lived go routine that deals with publish timeouts. After the low level publish, we used to create a new timer for the timeout of the publish call. This is replaced by adding the "ack" to the list of publish ack waiting to be timed-out. If an ack is processed from the server, the ack is removed from the map and the list. There was also an issue that on connection close we would "fail" pending publish acks, but invoke the callback from the connection close, which would have caused a deadlock if user invoke anything in the ack handler that requires the connection lock. Solve that by letting the publish ack timeout routine do that job. We could argue that on connection close we may not even want to do anything with those pending acks. Also fixed a bunch of tests. Resolves #294 Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
- Loading branch information
Showing
2 changed files
with
265 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.