mplatvoet
04/27/2016, 7:36 PM./gradlew
instead of gradle
carmas123
04/27/2016, 7:37 PMcarmas123
04/27/2016, 7:48 PMcarmas123
04/27/2016, 7:49 PMmplatvoet
04/27/2016, 7:49 PMcarmas123
04/27/2016, 7:59 PMcarmas123
04/27/2016, 7:59 PMmplatvoet
04/28/2016, 7:46 AMcarmas123
04/28/2016, 7:52 AMcarmas123
04/28/2016, 7:53 AMmplatvoet
04/28/2016, 7:57 AMmplatvoet
04/28/2016, 7:57 AMcarmas123
04/28/2016, 9:07 AMn3o59hf
04/28/2016, 4:44 PMmplatvoet
04/28/2016, 4:45 PMn3o59hf
04/28/2016, 10:24 PM-dontwarn nl.komponents.kovenant.unsafe.**
is enough to silence ProGuard warnings about missing classmplatvoet
04/29/2016, 6:14 AMn3o59hf
04/29/2016, 8:32 PMmplatvoet
04/29/2016, 9:47 PMmplatvoet
04/29/2016, 9:47 PMn3o59hf
05/02/2016, 3:21 PMn3o59hf
05/02/2016, 3:24 PMn3o59hf
05/02/2016, 3:40 PMmplatvoet
05/02/2016, 5:27 PMn3o59hf
05/03/2016, 8:19 PMmplatvoet
05/04/2016, 2:28 PMn3o59hf
05/05/2016, 12:13 PMmplatvoet
05/06/2016, 7:06 AMContext
for io since that tends to block, so something like this:
val ioContext = Kovenant.createContext {
workerContext.dispatcher = buildDispatcher {
concurrentTasks = 2 //whatever you prefer
}
//Use the default one
callbackContext.dispatcher = Kovenant.context.callbackContext.dispatcher
}
fun <V> ioTask(body: () -> V) : Promise<V, Exception> {
//execute the task on the io threads
val promise = task(ioContext, body)
//use default context for the rest of the work
return promise.withContext(Kovenant.context)
}
fun main(args: Array<String>) {
ioTask {
File("path/to/file").readText()
} then {
it.replace(":)", "☺")
} success {
println(it)
}
}
n3o59hf
05/07/2016, 8:59 PMmplatvoet
05/09/2016, 12:39 PMpollstrategy
as described http://kovenant.komponents.nl/api/core_config/#builddispatcher as this keeps threads alive. Though you need to shutdown the context manually.