Created
August 31, 2018 09:25
-
-
Save ktanaka117/557e24ff130e22ab07503c56f01a8c91 to your computer and use it in GitHub Desktop.
なんかasync/awaitの中でthread指定したい
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
// TODO: async/await実装したい | |
// TODO: ストリームの中でthread指定したい | |
protocol Awaitable { | |
associatedtype Value | |
// なんかDispatchQueueを返すメソッド...? | |
} | |
typealias CompletionHandler<T> = ((T) -> Awaitable<T>) | |
func getImage() async -> CompletionHandler {} | |
var image = await getImage().do(on: .main) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment