Class EventBusKt

  • All Implemented Interfaces:

    
    public final class EventBusKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      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.
      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.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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 state
        runScope - scope to run the application in; defaults to AppScope.appScope
        runCheck - function determines whether the app is running or not - must be thread safe; defaults to AppCommon .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 state
        runScope - scope to run the application in; defaults to AppScope.appScope
        runCheck - function determines whether the app is running or not - must be thread safe; defaults to AppCommon .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 sensor
        readFunction - function to read the sensor value
        checkInterval - the interval at which to check the sensor
        runScope - scope to run the application in; defaults to AppScope.appScope
        runCheck - function determines whether the app is running or not - must be thread safe; defaults to AppCommon .aplicationRunning