Class AsyncChannel.Producer<T>

java.lang.Object
groovy.concurrent.AsyncChannel.Producer<T>
Type Parameters:
T - the payload type
Enclosing interface:
AsyncChannel<T>

public static final class AsyncChannel.Producer<T> extends Object
Blocking sender for AsyncChannel.produce(int, Consumer).

send(Object) waits until the channel accepts the value, so a rendezvous producer does not run ahead of its consumer.

Since:
6.0.1
  • Method Details

    • send

      public void send(T value)
      Sends value and waits until it is buffered or delivered.
      Parameters:
      value - the value to send; must not be null
      Throws:
      ChannelClosedException - if the channel is closed
      NullPointerException - if value is null
    • getChannel

      public AsyncChannel<T> getChannel()
      Returns the channel this producer sends to.
      Returns:
      the underlying channel