aboutsummaryrefslogtreecommitdiffstats
path: root/ui/kotlinx-coroutines-javafx/test/guide/example-ui-actor-03.kt
diff options
context:
space:
mode:
Diffstat (limited to 'ui/kotlinx-coroutines-javafx/test/guide/example-ui-actor-03.kt')
-rw-r--r--ui/kotlinx-coroutines-javafx/test/guide/example-ui-actor-03.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/kotlinx-coroutines-javafx/test/guide/example-ui-actor-03.kt b/ui/kotlinx-coroutines-javafx/test/guide/example-ui-actor-03.kt
index 81371678..aa152b79 100644
--- a/ui/kotlinx-coroutines-javafx/test/guide/example-ui-actor-03.kt
+++ b/ui/kotlinx-coroutines-javafx/test/guide/example-ui-actor-03.kt
@@ -65,8 +65,8 @@ fun Node.onClick(action: suspend (MouseEvent) -> Unit) {
val eventActor = GlobalScope.actor<MouseEvent>(Dispatchers.Main, capacity = Channel.CONFLATED) { // <--- Changed here
for (event in channel) action(event) // pass event to action
}
- // install a listener to offer events to this actor
+ // install a listener to send events to this actor
onMouseClicked = EventHandler { event ->
- eventActor.offer(event)
+ eventActor.trySend(event)
}
}