Originally Posted by
Maxi
I don't let netty access the resources directly. The encoding executor creates the object that then can be handled fast and easy by the netty encoder. The reason why I do this is more because of a principle than anything else. I just like to keep my netty logic and core framework logic separated. Netty does its part and the core framework does its part in the encoding process. I could very well pass a new packet object instance to netty, but why should netty be busy with creating an object (thus creating the need of an extra decoder in the pipeline as well). The power of this framework is that you only create one packet class for a certain packet and write/edit its decode(), handleResources(), encodeObject() and encodeBuffer() methods. decode() and encodeBuffer() are both ran in netty's threads and handleResources() and encodeObject() in the core framework.