-
Notifications
You must be signed in to change notification settings - Fork 594
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
8.0: implement WaitForConfirmsAsync #999
8.0: implement WaitForConfirmsAsync #999
Conversation
/// We need to close the socket, otherwise attempting to unload the domain | ||
/// could cause a CannotUnloadAppDomainException | ||
/// </remarks> | ||
public void HandleDomainUnload(object sender, EventArgs ea) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was unused
@@ -750,7 +741,7 @@ public void MaybeStartHeartbeatTimers() | |||
|
|||
public void StartMainLoop() | |||
{ | |||
_mainLoopTask = Task.Run((Action)MainLoop); | |||
_mainLoopTask = Task.Factory.StartNew(MainLoop, TaskCreationOptions.LongRunning); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This forces the creation of a new thread instead of blocking one of the threadpool
string s = "payload"; | ||
if (length > s.Length) | ||
{ | ||
s.PadRight(length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This didn't work as a string is immutable and the returned new string was unused. So it always sent "payload" for all length inputs. => I removed most of the different cases (when I changed it to send the actual size it ran into timeouts due to the huge amount of data it tried to send.)
Proposed Changes
implements a async WaitForConfirms => does not block a thread anymore while waiting.
Types of Changes
Checklist
CONTRIBUTING.md
documentFurther Comments
This change partially fixes #959. Partially due to it only fixes the wait part and not the channel open part.
(Meaning as long as not all thread pool threads are blocked in opening channels, the publish works as expected. This can be achieved by either precreating channels or pooling the channels or making sure not all threads are started at the same time, so all create a channel at the same time (I'd argue this is already given by real world scenarios))