Class PropertySubscriber<T>

java.lang.Object
com.inductiveautomation.ignition.designer.mvvm.PropertySubscriber<T>
Type Parameters:
T - The type of the value that will be emitted by the publisher.
All Implemented Interfaces:
Flow.Subscriber<SubmissionContext<T>>

public class PropertySubscriber<T> extends Object implements Flow.Subscriber<SubmissionContext<T>>
This class is used to subscribe to a PropertyPublisherReadOnly and consume the values emitted by the publisher.
  • Constructor Details

    • PropertySubscriber

      public PropertySubscriber(Consumer<T> onNextConsumer)
      This constructor is used when you don't need access to the subscription. This version of the constructor is used when you only need to consume the value emitted by the publisher.
      Parameters:
      onNextConsumer - The consumer that will be called when a new value is emitted.
    • PropertySubscriber

      public PropertySubscriber(BiConsumer<SubmissionContext<T>,T> onNextConsumer)
      This constructor is used when you don't need access to the subscription. This version of the constructor is used when you need to consume the value emitted by the publisher and the SubmissionContext that is associated with the emission.
      Parameters:
      onNextConsumer - The consumer that will be called when a new value is emitted.
    • PropertySubscriber

      public PropertySubscriber(Consumer<Flow.Subscription> subscriptionConsumer, BiConsumer<SubmissionContext<T>,T> onNextConsumer)
      This constructor is used when you want to have access to the created subscription so that you can cancel the subscription when needed.
      Parameters:
      subscriptionConsumer - The consumer that will be called when the subscription is created.
      onNextConsumer - The consumer that will be called when a new value is emitted.
  • Method Details