Interface NozzleMetricsAction

All Known Implementing Classes:
NozzleMetricsTotalVolumeAction

public interface NozzleMetricsAction
Interface for metrics actions. When an action is added to a NozzleMetric, the action will be called every time the volume poured by the nozzle changes. This allows the action to perform actions based on data in the associated metric. This is a common mechanism for limiting pours to specific volumes or performing an action when a particular amount of a specific ingredient is poured.

Actions are called from the pour thread and should run as fast as possible.

Version:
2024-01-29
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Process a metrics change.
    void
    Reset the trigger.
  • Method Details

    • reset

      void reset()
      Reset the trigger. Called when the metrics is reset.
    • metricsChanged

      void metricsChanged(NozzleMetrics metrics)
      Process a metrics change. This is called from the thread that is processing pour events in order to provide metrics as fast as possible, but this means that actions should run as fast as possible. Consider performing any long running operations in a separate thread.
      Parameters:
      metrics - the metrics that changed