Interface AsyncTask<R>

Type Parameters:
R - task result type
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 AsyncTask<R>
Performs some task executing asynchronously and managed by an AsyncTaskManager.
  • Method Summary

    Modifier and Type
    Method
    Description
    perform(long id)
    Perform the task.
  • Method Details

    • perform

      R perform(long id) throws Exception
      Perform the task.

      This method runs in a background thread; in particular, no VaadinSession will be locked.

      This method should be prepared to handle an interrupt if/when cancelTask() is invoked; in that case this method may throw InterruptedException.

      This task may also cancel itself by throwing an unprompted InterruptedException.

      It is valid for this method to return null; no special meaning is attached to null return values.

      Parameters:
      id - the unique ID for this task run
      Returns:
      task result
      Throws:
      InterruptedException - if the current thread is interrupted
      Exception - if an error occurs during task execution