rename 'emit' method to 'publish'

This is to harmonize the API regardless what is the programming language