Class Callback.Combination

java.lang.Object
org.eclipse.jetty.util.Callback.Combination
All Implemented Interfaces:
AutoCloseable
Enclosing interface:
Callback

public static class Callback.Combination extends Object implements AutoCloseable
A combination of multiple Callbacks, that must all be completed before a specific callback is completed. For example:

   void sendToAll(String message, Collection<Channel> channels, Callback callback)
   {
       try (Callback.Combination combination = new Callback.Combination(callback))
       {
           for (Channel channel : channels)
               channel.send(message, combination.newCallback());
       }
   }