Skip to content
Snippets Groups Projects
Commit 33e583b7 authored by xujingfeng's avatar xujingfeng
Browse files

add onResponse note for async invocation

parent 7edf7c33
No related branches found
No related tags found
No related merge requests found
...@@ -27,4 +27,9 @@ public class TestClientFilter implements Filter { ...@@ -27,4 +27,9 @@ public class TestClientFilter implements Filter {
} }
} }
@Override
public Result onResponse(Result result, Invoker<?> invoker, Invocation invocation) {
return result;
}
} }
...@@ -11,11 +11,10 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -11,11 +11,10 @@ import java.util.concurrent.ConcurrentHashMap;
/** /**
* @author daofeng.xjf * @author daofeng.xjf
* * <p>
* 服务端回调服务 * 服务端回调服务
* 可选接口 * 可选接口
* 用户可以基于此服务,实现服务端向客户端动态推送的功能 * 用户可以基于此服务,实现服务端向客户端动态推送的功能
*
*/ */
public class CallbackServiceImpl implements CallbackService { public class CallbackServiceImpl implements CallbackService {
...@@ -26,14 +25,14 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -26,14 +25,14 @@ public class CallbackServiceImpl implements CallbackService {
if (!listeners.isEmpty()) { if (!listeners.isEmpty()) {
for (Map.Entry<String, CallbackListener> entry : listeners.entrySet()) { for (Map.Entry<String, CallbackListener> entry : listeners.entrySet()) {
try { try {
entry.getValue().receiveServerMsg(new Date().toString()); entry.getValue().receiveServerMsg(System.getProperty("quota") + " " + new Date().toString());
} catch (Throwable t1) { } catch (Throwable t1) {
listeners.remove(entry.getKey()); listeners.remove(entry.getKey());
} }
} }
} }
} }
}, 5000, 5000); }, 0, 5000);
} }
private Timer timer = new Timer(); private Timer timer = new Timer();
......
...@@ -27,4 +27,10 @@ public class TestServerFilter implements Filter { ...@@ -27,4 +27,10 @@ public class TestServerFilter implements Filter {
} }
} }
@Override
public Result onResponse(Result result, Invoker<?> invoker, Invocation invocation) {
return result;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment