okhttp3.Callback, ServerSentEventReader.Callback, EventSourcepublic final class RealEventSource extends java.lang.Object implements EventSource, ServerSentEventReader.Callback, okhttp3.Callback
EventSource.Factory| Constructor | Description |
|---|---|
RealEventSource(okhttp3.Request request,
EventSourceListener listener) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
cancel() |
Immediately and violently release resources held by this event source.
|
void |
connect(okhttp3.OkHttpClient client) |
|
void |
onEvent(java.lang.String id,
java.lang.String type,
java.lang.String data) |
|
void |
onFailure(okhttp3.Call call,
java.io.IOException e) |
|
void |
onResponse(okhttp3.Call call,
okhttp3.Response response) |
|
void |
onRetryChange(long timeMs) |
|
void |
processResponse(okhttp3.Response response) |
|
okhttp3.Request |
request() |
Returns the original request that initiated this event source.
|
public RealEventSource(okhttp3.Request request,
EventSourceListener listener)
public void connect(okhttp3.OkHttpClient client)
public void onResponse(okhttp3.Call call,
okhttp3.Response response)
onResponse in interface okhttp3.Callbackpublic void processResponse(okhttp3.Response response)
public void onFailure(okhttp3.Call call,
java.io.IOException e)
onFailure in interface okhttp3.Callbackpublic okhttp3.Request request()
EventSourcerequest in interface EventSourcepublic void cancel()
EventSourcecancel in interface EventSourcepublic void onEvent(@Nullable
java.lang.String id,
@Nullable
java.lang.String type,
java.lang.String data)
onEvent in interface ServerSentEventReader.Callbackpublic void onRetryChange(long timeMs)
onRetryChange in interface ServerSentEventReader.CallbackCopyright © 2020. All rights reserved.