File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
httpcore5/src/main/java/org/apache/hc/core5/http/nio Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -39,17 +39,32 @@ public interface AsyncDataProducer extends ResourceHolder {
39
39
* Returns the number of bytes immediately available for output.
40
40
* This method can be used as a hint to control output events
41
41
* of the underlying I/O session.
42
+ * <p>
43
+ * Please note this method should return zero if the data producer
44
+ * is unable to produce any more data, in which case
45
+ * {@link #produce(DataStreamChannel)} method will not get triggered.
46
+ * The producer can resume writing out data asynchronously
47
+ * once more data becomes available or request output readiness events
48
+ * with {@link DataStreamChannel#requestOutput()}.
42
49
*
43
50
* @return the number of bytes immediately available for output
51
+ *
52
+ * @see #produce(DataStreamChannel)
53
+ * @see DataStreamChannel#requestOutput()
44
54
*/
45
55
int available ();
46
56
47
57
/**
48
58
* Triggered to signal the ability of the underlying data channel
49
59
* to accept more data. The data producer can choose to write data
50
60
* immediately inside the call or asynchronously at some later point.
61
+ * <p>
62
+ * Please note this method gets triggered only if {@link #available()}
63
+ * returns a positive value.
64
+ *
65
+ * @param channel the data channel capable of accepting more data.
51
66
*
52
- * @param channel the data channel capable to accepting more data.
67
+ * @see #available()
53
68
*/
54
69
void produce (DataStreamChannel channel ) throws IOException ;
55
70
You can’t perform that action at this time.
0 commit comments