Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
Updated to 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz committed Aug 27, 2017
1 parent 6648fbd commit c872629
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
@@ -1,4 +1,4 @@
korVersion=0.11.0
jtranscVersion=0.6.6
kotlinVersion=1.1.3-2
vertxVersion=3.3.3
korVersion=0.12.0
jtranscVersion=0.6.7
kotlinVersion=1.1.4-2
vertxVersion=3.4.2
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Sat Aug 05 14:31:24 CEST 2017
#Sun Aug 27 17:46:42 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
25 changes: 16 additions & 9 deletions korio-vertx/src/com/soywiz/korio/vertx/VertxEventLoop.kt
Expand Up @@ -28,15 +28,22 @@ class VertxEventLoop : EventLoop() {
}

override fun setTimeoutInternal(ms: Int, callback: () -> Unit): Closeable {
var done = false
val timer = _vertx.setTimer(ms.toLong()) {
done = true
callback()
}
return Closeable {
if (!done) {
done = true
_vertx.cancelTimer(timer)
if (ms < 1) {
var cancelled = false
_vertx.runOnContext {
if (!cancelled) callback()
}
return Closeable {
cancelled = true
}
} else {
var done = false
val timer = _vertx.setTimer(ms.toLong()) { done = true; callback() }
return Closeable {
if (!done) {
done = true
_vertx.cancelTimer(timer)
}
}
}
}
Expand Down

0 comments on commit c872629

Please sign in to comment.