Skip to content

Instantly share code, notes, and snippets.

@ktanaka117
Created August 31, 2018 09:25
Show Gist options
  • Save ktanaka117/557e24ff130e22ab07503c56f01a8c91 to your computer and use it in GitHub Desktop.
Save ktanaka117/557e24ff130e22ab07503c56f01a8c91 to your computer and use it in GitHub Desktop.
なんかasync/awaitの中でthread指定したい
// 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