Class EventBusKt
-
- All Implemented Interfaces:
public final class EventBusKt
-
-
Method Summary
Modifier and Type Method Description final static UnitstartAsync(Button $self, Duration checkInterval, CoroutineScope runScope, Function0<Boolean> runCheck)Start monitoring the button for press events and publish KobotsButtonEvent on press. final static UnitstartAsync(NeoKeyHandler $self, Duration checkInterval, CoroutineScope runScope, Function0<Boolean> runCheck)Start monitoring the NeoKey buttons for press events and publish NeoKeyEvent on press. final static <T extends Any> UnitstartSensorPublish(String sensorName, Function0<T> readFunction, Duration checkInterval, CoroutineScope runScope, Function0<Boolean> runCheck)Start monitoring a sensor by periodically calling readFunction and publishing the result as a KobotSensorEvent. -
-
Method Detail
-
startAsync
final static Unit startAsync(Button $self, Duration checkInterval, CoroutineScope runScope, Function0<Boolean> runCheck)
Start monitoring the button for press events and publish KobotsButtonEvent on press.
- Parameters:
checkInterval- the interval at which to check the button staterunScope- scope to run the application in; defaults toAppScope.appScoperunCheck- function determines whether the app is running or not - must be thread safe; defaults toAppCommon .aplicationRunning
-
startAsync
final static Unit startAsync(NeoKeyHandler $self, Duration checkInterval, CoroutineScope runScope, Function0<Boolean> runCheck)
Start monitoring the NeoKey buttons for press events and publish NeoKeyEvent on press.
- Parameters:
checkInterval- the interval at which to check the button staterunScope- scope to run the application in; defaults toAppScope.appScoperunCheck- function determines whether the app is running or not - must be thread safe; defaults toAppCommon .aplicationRunning
-
startSensorPublish
final static <T extends Any> Unit startSensorPublish(String sensorName, Function0<T> readFunction, Duration checkInterval, CoroutineScope runScope, Function0<Boolean> runCheck)
Start monitoring a sensor by periodically calling readFunction and publishing the result as a KobotSensorEvent.
- Parameters:
sensorName- the name of the sensorreadFunction- function to read the sensor valuecheckInterval- the interval at which to check the sensorrunScope- scope to run the application in; defaults toAppScope.appScoperunCheck- function determines whether the app is running or not - must be thread safe; defaults toAppCommon .aplicationRunning
-
-
-
-