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
ConstructorDescriptionCustomSseAsyncConsumer
(Integer capacity, AbstactEventFutureCallback<SseResponse, Event> callback, Integer timeWait) CustomSseAsyncConsumer
(org.apache.hc.core5.concurrent.FutureCallback<Event> listener) -
Method Summary
Modifier and TypeMethodDescriptionprotected SseResponse
protected int
protected void
data
(CharBuffer data, boolean endOfStream) void
void
protected void
start
(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, informationResponse
Methods inherited from class org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
consume, setCharset, streamEnd, updateCapacity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
start
in classorg.apache.hc.client5.http.async.methods.AbstractCharResponseConsumer<SseResponse>
- Throws:
org.apache.hc.core5.http.HttpException
IOException
-
capacityIncrement
protected int capacityIncrement()- Specified by:
capacityIncrement
in classorg.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
-
data
- Specified by:
data
in classorg.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer
- Throws:
IOException
-
buildResult
- Specified by:
buildResult
in classorg.apache.hc.client5.http.async.methods.AbstractCharResponseConsumer<SseResponse>
-
releaseResources
public void releaseResources() -
failed
- Specified by:
failed
in interfaceorg.apache.hc.core5.http.nio.AsyncResponseConsumer<SseResponse>
- Overrides:
failed
in classorg.apache.hc.client5.http.async.methods.AbstractCharResponseConsumer<SseResponse>
-