rename emitEvent to dispatcher, inline yields