PlatformTimeUpdateNotifier


public interface PlatformTimeUpdateNotifier


Interface used to notify all time based dynamic types that they should be updated with the new platform time (system time).

It's up to the implementations to chose at what frequency updates should be sent.

Summary

Public methods

abstract void

Clears the receiver from the notifier.

abstract void

Sets the callback to be called whenever platform time needs to be reevaluated.

Public methods

clearReceiver

Added in 1.0.0
abstract void clearReceiver()

Clears the receiver from the notifier.

setReceiver

Added in 1.0.0
abstract void setReceiver(@NonNull Executor executor, @NonNull Runnable tick)

Sets the callback to be called whenever platform time needs to be reevaluated.

Calling this method while there is already a receiver set, should replace the previous receiver.

Parameters
@NonNull Executor executor

The Executor to run the given tick on.

@NonNull Runnable tick

The callback to run whenever platform time needs to be reevaluated. This callback should be invoked by the implementation of this interface whenever platform time needs to be reevaluated.