perhaps check `queue` first, because it will be non-empty more often?