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