Alxandr / SpotiFire

A project to make a SpotifyClient in C#
http://nudoc.azurewebsites.net/SpotiFire
40 stars 19 forks source link

Make Browse-functions return Task that completes when the browse is completed. #38

Closed Alxandr closed 10 years ago

Alxandr commented 11 years ago

Currently when you do stuff like album.Browse() the method returns you an AlbumBrowse object right away even though the operation is async. AlbumBrowse is awaitable, so calling await on it resolves this issue, but it's still possible to misunderstand how this works and expect the result to be usable at once.

All Browse and Search functions should return Tasks given from TaskCompletionSources. This also removes the dependency on the custom await-code written, which should in time entirely be removed (a bit more work on other things like Playlist is required for this though).