Allow passing publish callback as last argument of emit

@freeall that should be OK