Add callback to Connection.publish