watchFile

fun <R> watchFile(file: File, valueChangedEvent: Event<R>? = null, requestStopEvent: Event<Unit>? = null, transducer: (File) -> R): () -> R(source)

Watch a file for changes

Parameters

file

the file to watch

valueChangedEvent

the event that is triggered when the value (after transforming) has changed

requestStopEvent

an event that can be triggered to request the watcher to stop

transducer

a function that transforms a File into a value of type R