Hprose 过滤器 - 执行顺序
优质
小牛编辑
137浏览
2023-12-01
不论是客户端,还是服务器,都可以添加多个过滤器。假设我们按照添加的顺序把它们叫做 filter1
, filter2
, … filterN
。那幺它们的执行顺序是这样的。
在客户端的执行顺序
+------------------- OutputFilter -------------------+
| +-------+ +-------+ +-------+ |
| |filter1|----->|filter2|-----> ... ----->|filterN| |---------+
| +-------+ +-------+ +-------+ | v
+----------------------------------------------------+ +---------------+
| Hprose Server |
+-------------------- InputFilter -------------------+ +---------------+
| +-------+ +-------+ +-------+ | |
| |filter1|<-----|filter2|<----- ... <-----|filterN| |<--------+
| +-------+ +-------+ +-------+ |
+----------------------------------------------------+
在服务器端的执行顺序
+-------------------- InputFilter -------------------+
| +-------+ +-------+ +-------+ |
+-------->| |filterN|-----> ... ----->|filter2|----->|filter1| |
| | +-------+ +-------+ +-------+ |
+---------------+ +----------------------------------------------------+
| Hprose Client |
+---------------+ +------------------- OutputFilter -------------------+
^ | +-------+ +-------+ +-------+ |
+---------| |filterN|<----- ... <-----|filter2|<-----|filter1| |
| +-------+ +-------+ +-------+ |
+----------------------------------------------------+