PolyProcessInterface / ppi

2 stars 2 forks source link

perf(generic): save MessageHandlers in a Map #82

Closed n-peugnet closed 4 years ago

n-peugnet commented 4 years ago

This commit adds the MessageDispatcher class and uses it in NodeProcess. This way the NodeProcess is processed only once and the result is saved in a Map so it can be quickly accessed on each call to processMessage. Also it adds a check to make sure that there is only one handler for each class of Message.

Related to #49, this makes me wonder if the annotation processor really is a good idea. Maybe the processor could be able to generate a class that would automatically call the correct method without using reflexivity ?