Skip to content

Remove the old OnDisconnected overload#3126

Merged
halter73 merged 2 commits into
releasefrom
bug-3115
Jul 22, 2014
Merged

Remove the old OnDisconnected overload#3126
halter73 merged 2 commits into
releasefrom
bug-3115

Conversation

@halter73
Copy link
Copy Markdown
Member

See @moozzyk's comment on the outdated diff to see why this makes sense.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually care that these are sequential? Can we do a Task.WhenAll?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling events in parallel on the same object doesn't seem right. I'd leave it sequential.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we're using ContinueWith with the Unwrap instead of one of our Then overloads?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be finally probably. Why do we care if one failed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally doesn't take a Func, and I need to return the Task from the second call to OnDisconnected. Should I make a new Finallly helper that takes a Func?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion we should remove the OnDisconnect() overload entirely for the following reasons:

  • we will start breaking people who are using both overloads - they suddenly will start getting duplicate notifications. This is an implicit breaking change you would only discover at runtime (can be hard to track)
  • having two overloads can create a lot of confusion
  • you don't need to worry if the order invoking is important

So, because we are making a breaking change anyway removing the OnDisconnect() overload seems better since the change can be discovered at design time when upgrading to the new version and will make the API clean.
(already talked to @halter73 about this)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@moozzyk 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good point. It's the change we probably should have made in the first place. Simplifies everything and we don't need to explain what one overload does over the other or add any of this new task plumbing code.

@halter73 halter73 changed the title Call the preexisting OnDisconnected methods for all disconnects Remove the old OnDisconnected overload Jul 17, 2014
@moozzyk
Copy link
Copy Markdown
Contributor

moozzyk commented Jul 17, 2014

🚢🇮🇹

@halter73 halter73 merged commit 1cf6a67 into release Jul 22, 2014
@halter73 halter73 deleted the bug-3115 branch July 22, 2014 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants