未完待续,本文目前仅用于跟图灵论坛上的同学交流。
参考文章可以从这里(https://files.cnblogs.com/DesignPatterns/Act-Obj.pdf)下载。
Active Object要解决的问题
举例来说,在如下图所示的系统中,我们希望Gateway两端的Supplier和Consumer通信的过程中,Gateway的进程不能阻塞(must not block waiting for flow control to abate over any one connection to a consumer.)。而且,在Supplier和Consumer增加的时候,Gateway应该能够高效地扩展。
参考资料:
1. Active Object - An Object Behavioral Pattern for Concurrent Programming - R. Greg Lavender, Douglas C. Schmidt