Interface AsyncGroup


public sealed interface AsyncGroup
Manages asynchronous background tasks executed during data source and data connection lifecycle events.

An instance of AsyncGroup is passed to methods of DataSrc (such as DataSrc.setup(AsyncGroup)) and DataConn (such as DataConn.commit(AsyncGroup) and DataConn.rollback(AsyncGroup)). Implementations of data sources and data connections can register background asynchronous operations (such as parallel cleanup or pre-commit validations) using the add(Runner) method.

All registered Runner tasks are managed by this group and executed asynchronously. If any registered task fails, is interrupted, or throws an unhandled runtime exception, corresponding error records defined in this interface are produced to report the failure.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Indicates that a registered Runner task failed during its execution.
    static final record 
    Indicates that a registered Runner task execution was interrupted.
    static final record 
    Indicates that an unhandled runtime exception was thrown during the execution of a registered Runner task.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Runner runner)
    Adds a background task to be executed asynchronously by this group.
  • Method Details

    • add

      void add(Runner runner)
      Adds a background task to be executed asynchronously by this group.

      The task is encapsulated in a Runner functional interface and scheduled for parallel asynchronous execution.

      Parameters:
      runner - the Runner task to be added and executed asynchronously