public abstract class AbstractStreamListener
extends okhttp3.sse.EventSourceListener
| Modifier and Type | Field and Description |
|---|---|
protected String |
lastMessage |
protected Consumer<String> |
onComplate
Called when all new message are received.
|
| Constructor and Description |
|---|
AbstractStreamListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
onClosed(okhttp3.sse.EventSource eventSource) |
abstract void |
onError(Throwable throwable,
String response)
Called when an error occurs.
|
void |
onEvent(okhttp3.sse.EventSource eventSource,
String id,
String type,
String data) |
void |
onFailure(okhttp3.sse.EventSource eventSource,
Throwable throwable,
okhttp3.Response response) |
abstract void |
onMsg(String message)
Called when a new message is received.
|
void |
onOpen(okhttp3.sse.EventSource eventSource,
okhttp3.Response response) |
protected String lastMessage
public abstract void onMsg(String message)
message - the new messagepublic abstract void onError(Throwable throwable, String response)
throwable - the throwable that caused the errorresponse - the response associated with the error, if anypublic void onOpen(okhttp3.sse.EventSource eventSource,
okhttp3.Response response)
onOpen in class okhttp3.sse.EventSourceListenerpublic void onClosed(okhttp3.sse.EventSource eventSource)
onClosed in class okhttp3.sse.EventSourceListenerpublic void onEvent(okhttp3.sse.EventSource eventSource,
String id,
String type,
String data)
onEvent in class okhttp3.sse.EventSourceListenerpublic void onFailure(okhttp3.sse.EventSource eventSource,
Throwable throwable,
okhttp3.Response response)
onFailure in class okhttp3.sse.EventSourceListenerCopyright © 2023. All rights reserved.