February 2018
Intermediate to advanced
350 pages
7h 35m
English
Another option to write asynchronous code is to use promises. A promise is similar to a future (in many frameworks, futures and promises are synonymous), as it represents a computation that may complete in the future. We have a blocking method to obtain its result, but we can also react to its result, callback style.
Kovenant (http://kovenant.komponents.nl/) is an implementation of promises for Kotlin:
import nl.komponents.kovenant.Promiseimport nl.komponents.kovenant.taskimport nl.komponents.kovenant.thenclass PromiseUserService(private val userClient: UserClient, private val factClient: FactClient, private val userRepository: UserRepository, private val factRepository: FactRepository) : UserService { override fun ...
Read now
Unlock full access