Interface DittoAsyncCancellable

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DittoAsyncCancellable

Represents an asynchronous operation that can be cancelled.

This functional interface is returned by various Ditto methods that start asynchronous operations, such as subscriptions, observers, and sync operations. Call cancel() to stop the operation and clean up any associated resources.

Example usage:

`DittoAsyncCancellable cancellable = ditto.sync().registerSubscription("SELECT * FROM cars");// Later, when you want to stop the subscription:cancellable.cancel();`
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancels the asynchronous operation.
  • Method Details

    • cancel

      void cancel()

      Cancels the asynchronous operation.

      After calling this method, the operation will stop and any associated resources will be cleaned up. This method is idempotent - calling it multiple times has the same effect as calling it once.