observe

fun observe(eventHandler: (DiskUsageItem) -> Unit): Closeable

Observe disk usage using a lambda expression. The lambda will be invoked regularly delivering updated disk usage info until the returned handle goes out of scope or its close() method invoked.

Parameters

eventHandler

Lambda expression which will be called with DiskUsageItem when there are updates.


Observe disk usage using a callback class (for Java compatibility). The callback will be invoked regularly delivering updated disk usage info until the returned handle goes out of scope or its close() method is invoked.

Parameters

callback

Implementation of DiskUsageCallback which will be called with updates.