ParStream sortBy function