All Known Implementing Classes:
Callback.Completable

public interface Callback
Callback for Write events.

NOTE: We don't expose org.eclipse.jetty.util.Callback here as that would complicate matters with the WebAppContext's classloader isolation.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
     
  • Field Summary

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

    Modifier and Type
    Method
    Description
    default void
    Callback invoked when the write fails.
    static Callback
    from(Runnable success, Consumer<Throwable> failure)
    Creates a callback from the given success and failure lambdas.
    default void
    Callback invoked when the write succeeds.
  • Field Details

  • Method Details

    • from

      static Callback from(Runnable success, Consumer<Throwable> failure)
      Creates a callback from the given success and failure lambdas.
      Parameters:
      success - called when the callback succeeds
      failure - called when the callback fails
      Returns:
      a new callback
    • succeed

      default void succeed()

      Callback invoked when the write succeeds.

      See Also:
    • fail

      default void fail(Throwable x)

      Callback invoked when the write fails.

      Parameters:
      x - the reason for the write failure