johnding1996 / HKUST-COMP3111H-Group

Group Project of COMP 3111H in Fall 2017 at HKUST
Apache License 2.0
0 stars 0 forks source link

Reactor mode #24

Closed gongaa closed 7 years ago

gongaa commented 7 years ago

Thomas suggests that we use reactor mode instead of observer mode, this mode has been tested, running successfully. For each module (except Formatter), I think you will need both publish and receive function. To achieve this, you will need only one Publisher, but several receiver modules. I have construct a Publisher class, all the modules will use this by directly adding a publishXXXXJSON() method to it (e.g. publishFoodListJSON), I will state it more explicitly on Wiki. But you are not only going to receive ParserMessageJSON object, and the receiver can only implement one type of Consumer<event> interface, so you need various receiver module. For this I have provided the TemplateModule for your reference.

thomaszhouan commented 7 years ago

The code example for using reactor for message passing will be included in wiki