E58F Add non blocking bounded queue FeedableBodyGenerator · lovejavaee/async-http-client@4a0d2d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4a0d2d7

Browse files
committed
Add non blocking bounded queue FeedableBodyGenerator
1 parent 1ef6d82 commit 4a0d2d7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@
1616
import java.util.concurrent.ArrayBlockingQueue;
1717
import java.util.concurrent.BlockingQueue;
1818

19-
public final class BlockingQueueFeedableBodyGenerator extends QueueBasedFeedableBodyGenerator<BlockingQueue<BodyChunk>> {
19+
public final class BoundedQueueFeedableBodyGenerator extends QueueBasedFeedableBodyGenerator<BlockingQueue<BodyChunk>> {
2020

21-
public BlockingQueueFeedableBodyGenerator(int capacity) {
21+
public BoundedQueueFeedableBodyGenerator(int capacity) {
2222
super(new ArrayBlockingQueue<>(capacity, true));
2323
}
2424

2525
@Override
2626
protected boolean offer(BodyChunk chunk) throws InterruptedException {
27-
queue.put(chunk);
28-
return true;
27+
return queue.offer(chunk);
2928
}
3029
}

0 commit comments

Comments
 (0)
0