Interface AsyncCloseable

All Known Subinterfaces:
ReactiveProcess
All Known Implementing Classes:
AbstractAsyncCloseable, AsyncAccumulator

public interface AsyncCloseable
Describes methods that are used to handle exceptional behaviour or to handle closing.

After close(), or closeEx(Exception) is called, the following things should be done:

  • Resources held by an object should be freed
  • All pending asynchronous operations should be completed exceptionally
All operations of this interface are idempotent.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Object
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Cancels the process.
    void
    Closes process exceptionally in case an exception is thrown while executing the given process.
    of(Consumer<Exception> exceptionConsumer)
     
  • Field Details

    • STATIC

      static final Object STATIC
  • Method Details

    • close

      default void close()
      Cancels the process.
    • closeEx

      void closeEx(Exception e)
      Closes process exceptionally in case an exception is thrown while executing the given process.
      Parameters:
      e - exception that is used to close process with
    • of

      static AsyncCloseable of(Consumer<Exception> exceptionConsumer)