-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
487b8f8
commit e923e16
Showing
10 changed files
with
236 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
forest-core/src/main/java/com/dtflys/forest/interceptor/SSEInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.dtflys.forest.interceptor; | ||
|
||
import com.dtflys.forest.http.ForestRequest; | ||
import com.dtflys.forest.http.ForestResponse; | ||
import com.dtflys.forest.sse.EventSource; | ||
|
||
/** | ||
* Forest SSE 拦截器 | ||
* | ||
* @since 1.6.1 | ||
*/ | ||
public interface SSEInterceptor extends Interceptor { | ||
|
||
/** | ||
* 监听打开回调函数:在开始 SSE 数据流监听的时候调用 | ||
* | ||
* @param eventSource SSE 事件来源 | ||
* @since 1.6.1 | ||
*/ | ||
default void onSSEOpen(EventSource eventSource) { | ||
} | ||
|
||
/** | ||
* 监听关闭回调函数:在结束 SSE 数据流监听的时候调用 | ||
* | ||
* @param request Forest 请求对象 | ||
* @param response Forest 响应对象 | ||
* @since 1.6.1 | ||
*/ | ||
default void onSSEClose(ForestRequest request, ForestResponse response) { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.