public final class DefaultAsyncChannel<T>
extends Object
implements AsyncChannel
Default lock-based implementation of AsyncChannel.
Uses a ReentrantLock to coordinate access to the internal buffer and the waiting-sender/waiting-receiver queues. All operations return Awaitable immediately; the underlying CompletableFuture is completed asynchronously when matching counterparts arrive.
T - the payload type| Constructor and description |
|---|
DefaultAsyncChannel() |
DefaultAsyncChannel(int capacity) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public boolean |
close() |
|
public int |
getBufferedSize() |
|
public int |
getCapacity() |
|
public boolean |
isClosed() |
|
public Iterator<T> |
iterator()Returns a blocking iterator that receives values until the channel is closed and drained. |
|
public Awaitable<T> |
receive() |
|
public Awaitable<Void> |
send(T value) |
|
public String |
toString() |
Returns a blocking iterator that receives values until the channel
is closed and drained. Each next() call blocks until a value
is available. ChannelClosedException signals end-of-iteration.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.