1
0
mirror of https://github.com/square/okhttp.git synced 2025-08-07 12:42:57 +03:00
Files
okhttp/okhttp-sse/api/okhttp-sse.api
Jesse Wilson f131fae164 Change SSE to use the OkHttp public API only (#8141)
* Change SSE to use the OkHttp public API only

Previously we prevented end-users from using their own
implementations of Call.Factory because we casted down
to RealCall in RealEventSource.

With this change we're implementing SSE without depending
on any OkHttp implementation details.

This also introduces a new function in EventSources to
create an EventSource.Factory from a Call.Factory, and
hides the previous implementation that required a concrete
OkHttpClient.

Finally this fixes SSE to publish the same EventListener
events as regular HTTP calls.

* apiDump
2023-12-17 09:39:59 -05:00

25 lines
1.1 KiB
Plaintext

public abstract interface class okhttp3/sse/EventSource {
public abstract fun cancel ()V
public abstract fun request ()Lokhttp3/Request;
}
public abstract interface class okhttp3/sse/EventSource$Factory {
public abstract fun newEventSource (Lokhttp3/Request;Lokhttp3/sse/EventSourceListener;)Lokhttp3/sse/EventSource;
}
public abstract class okhttp3/sse/EventSourceListener {
public fun <init> ()V
public fun onClosed (Lokhttp3/sse/EventSource;)V
public fun onEvent (Lokhttp3/sse/EventSource;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
public fun onFailure (Lokhttp3/sse/EventSource;Ljava/lang/Throwable;Lokhttp3/Response;)V
public fun onOpen (Lokhttp3/sse/EventSource;Lokhttp3/Response;)V
}
public final class okhttp3/sse/EventSources {
public static final field INSTANCE Lokhttp3/sse/EventSources;
public static final fun createFactory (Lokhttp3/Call$Factory;)Lokhttp3/sse/EventSource$Factory;
public static final synthetic fun createFactory (Lokhttp3/OkHttpClient;)Lokhttp3/sse/EventSource$Factory;
public static final fun processResponse (Lokhttp3/Response;Lokhttp3/sse/EventSourceListener;)V
}