Added support for giving a callback on the engine side when sending a message