xhanthow edited a comment on issue #2091:
URL:
https://github.com/apache/servicecomb-java-chassis/issues/2091#issuecomment-735513368
嗯,把代码下下来看了下,这里就启动了`Filter`链(感觉和之前的`Handler`有点像,`invocation.next(xxx)`)
```java
public CompletableFuture<Response> onFilter(Invocation invocation) {
if (!filter.enabled()) {
return nextNode.onFilter(invocation);
}
return AsyncUtils.tryCatch(() -> filter.onFilter(invocation, nextNode))
.thenApply(this::rethrowExceptionInResponse);
}
```
而且现在`Filter`可以使用`Autowire`了吧 :)
```java
engine.getApplicationContext().getAutowireCapableBeanFactory().autowireBean(filter)
```
不过我现在还有个疑问,就是我在`Handler`中用了异步(如issue中第一个描述中的代码),自己定义的线程池,然后我`debug`的时候发现后续的`Invocation#next`执行的时候也都在我自定义的线程池中执行,后续的操作还有可能切换到eventloop线程中执行么?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]