-
Notifications
You must be signed in to change notification settings - Fork 522
Implement bolts.TaskCompletionSource, deprecate bolts.Task.TaskCompletionSource #84
Conversation
…tionSource Removes the weird syntax: ```java // Before: Task<Void>.TaskCompletionSource tcs = Task.create(); // After: TaskCompletionSource<Void> tcs = Task.create(); TaskCompletionSource<Void> tcs = new TaskCompletionSource<>(); ``` Deprecated APIs: `bolts.Task<TResult>.TaskCompletionSource` `bolts.Task.create()` New APIs: `bolts.TaskCompletionSource<TResult>` (new class, same methods as from `bolts.Task<TResult>.TaskCompletionSource`) `new bolts.TaskCompletionSource<>()` The constructor is so that we don't always have to use `Task.create()` which creates the anonymous inner class bs.
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.
Not sure if intentional or not...
|
This is awesome! |
|
|
|
Looks fine to me. Seems like a breaking change? ( |
|
@hallucinogen how does that break? TaskCompletionSource<Void> tcs = Task.create();
Task<Void>.TaskCompletionSource tcs = Task.create();I've also added a unit test to ensure this. |
|
@depoll it'd be great to get your opinion on this when you can 😄 |
Implement bolts.TaskCompletionSource, deprecate bolts.Task.TaskCompletionSource
Removes the weird syntax:
Deprecated APIs:
bolts.Task<TResult>.TaskCompletionSourcebolts.Task.create()New APIs:
bolts.TaskCompletionSource<TResult>(new class, same methods as frombolts.Task<TResult>.TaskCompletionSource)new bolts.TaskCompletionSource<>()The constructor is so that we don't always have to use
Task.create()which creates the anonymous inner class bs.