The Reactor pattern serves precisely this function.
反应器模式正好适用于这一功能。
The Observer pattern is associated with a single source of events, however, whereas the Reactor pattern is associated with multiple sources of events.
不过,观察者模式与单个事件源关联,而反应器模式则与多个事件源关联。
In keeping with the Reactor pattern, a Selector class is a multiplexor of Channels.
与反应器模式一致,Selector类是Channel的多路复用器。
应用推荐