Package com.luna.common.net.async
Class CustomSseAsyncConsumer
java.lang.Object
org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
org.apache.hc.client5.http.async.methods.AbstractCharResponseConsumer<SseResponse>
com.luna.common.net.async.CustomSseAsyncConsumer
- All Implemented Interfaces:
org.apache.hc.core5.http.nio.AsyncDataConsumer,org.apache.hc.core5.http.nio.AsyncResponseConsumer<SseResponse>,org.apache.hc.core5.http.nio.ResourceHolder
public class CustomSseAsyncConsumer
extends org.apache.hc.client5.http.async.methods.AbstractCharResponseConsumer<SseResponse>
- Author:
- luna
- Description:
-
Field Summary
Fields inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
DEF_BUF_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionCustomSseAsyncConsumer(Integer capacity, AbstactEventFutureCallback<SseResponse, Event> callback, Integer timeWait) CustomSseAsyncConsumer(org.apache.hc.core5.concurrent.FutureCallback<Event> listener) -
Method Summary
Modifier and TypeMethodDescriptionprotected SseResponseprotected intprotected voiddata(CharBuffer data, boolean endOfStream) voidvoidprotected voidstart(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.ContentType contentType) Methods inherited from class org.apache.hc.client5.http.async.methods.AbstractCharResponseConsumer
completed, consumeResponse, informationResponseMethods inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
consume, setCharset, streamEnd, updateCapacityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hc.core5.http.nio.AsyncDataConsumer
consume, streamEnd, updateCapacity
-
Constructor Details
-
CustomSseAsyncConsumer
-
CustomSseAsyncConsumer
public CustomSseAsyncConsumer(Integer capacity, AbstactEventFutureCallback<SseResponse, Event> callback, Integer timeWait) -
CustomSseAsyncConsumer
public CustomSseAsyncConsumer() -
CustomSseAsyncConsumer
-
-
Method Details
-
start
protected void start(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.ContentType contentType) throws org.apache.hc.core5.http.HttpException, IOException - Specified by:
startin classorg.apache.hc.client5.http.async.methods.AbstractCharResponseConsumer<SseResponse>- Throws:
org.apache.hc.core5.http.HttpExceptionIOException
-
capacityIncrement
protected int capacityIncrement()- Specified by:
capacityIncrementin classorg.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
-
data
- Specified by:
datain classorg.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer- Throws:
IOException
-
buildResult
- Specified by:
buildResultin classorg.apache.hc.client5.http.async.methods.AbstractCharResponseConsumer<SseResponse>
-
releaseResources
public void releaseResources() -
failed
- Specified by:
failedin interfaceorg.apache.hc.core5.http.nio.AsyncResponseConsumer<SseResponse>- Overrides:
failedin classorg.apache.hc.client5.http.async.methods.AbstractCharResponseConsumer<SseResponse>
-