-
Notifications
You must be signed in to change notification settings - Fork 364
Refactoring libboostasio (part 5) #562
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
Open
paolopas
wants to merge
23
commits into
CopernicaMarketingSoftware:master
Choose a base branch
from
paolopas:boosted-cld-5
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Refactoring libboostasio (part 5) #562
paolopas
wants to merge
23
commits into
CopernicaMarketingSoftware:master
from
paolopas:boosted-cld-5
+867
−320
Conversation
This file contains hidden or 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
replaces get_dispatch_wrapper, switched from boost:: to std::bind and std::function
…re#464) appended LibBoostAsioHandler ctor parameter (with default value) uint16_t connection_timeout = 60
slow down the heartbeat emission if the client has already sent data within the negotiated timeout, a similar improvement was suggested for LivEvHandler in CopernicaMarketingSoftware#550
race condition due to *_pending flags no more possible, updated footnote with important information for handler's user
final notes updated
called by destructor to prevent deadlocks, relaxed assert in monitor to allow early realeses, final notes update
method events renamed to set_event_mask
to the parent and no longer need the managed pointers for the strand
This was referenced Dec 19, 2025
Author
|
A couple of class diagrams explain what happened in ddc1662 better than a lot of chatter. Before the situation was like this classDiagram
LibBoostAsioHandler : SharedPtr~Strand~ _strand
LibBoostAsioHandler : Map~int SharedPtr~Watcher~~ _watchers
LibBoostAsioHandler *-- Watcher : _watchers
Watcher : WeakPtr~Strand~ _wpstrand
Watcher o-- LibBoostAsioHandler : _wpstrand
and this is how it is now classDiagram
LibBoostAsioHandler : Strand _strand
LibBoostAsioHandler : Map~int SharedPtr~Watcher~~ _watchers
LibBoostAsioHandler *-- Watcher : _watchers
Watcher : LibBoostAsioHandler* _parent
Watcher --> LibBoostAsioHandler : _parent
As you can see there is still a lot of room for improvement. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note
This is the fifth child, the code is branched from #558 (fourth child), so this one accumulate the changes.
Each commit has been checked for regressions.
releasemethod (protected) and removal of theassertin themonitormethod, as it is now possible for managed connections to be released early (as described in libboostasio fully refactored #550 (comment))Watcher::eventsmethod toset_event_maskI'm attaching the current version of the handler (with example test included) for anyone curious to read or experiment.
Important
libboostasio_2025-12-19.zip