txt: ## race.md
  race
  
  Combined from primary sources listed below.
  
  # [In role Iterable](#___top "go to top of document")[§](#(role_Iterable)_method_race "direct link")
  
  See primary documentation
  [in context](/type/Iterable#method_race)
  for **method race**.
  
  ```raku
  method race(Int(Cool) :$batch = 64, Int(Cool) :$degree = 4 --> Iterable)
  ```
  
  Returns another Iterable that is potentially iterated in parallel, with a given batch size and degree of parallelism (number of parallel workers).
  
  Unlike [`hyper`](/routine/hyper), `race` does not preserve the order of elements (mnemonic: in a race, you never know who will arrive first).
  
  ```raku
  say ([1..100].race.map({ $_ +1 }).list);
  ```
  
  Use race in situations where it is OK to do the processing of items in parallel, and the output order does not matter. See [`hyper`](/routine/hyper) for situations where you want items processed in parallel and the output order should be kept relative to the input order.
  
  **[Blog post on the semantics of hyper and race](https://6guts.wordpress.com/2017/03/16/considering-hyperrace-semantics/)**
  
  See [`hyper`](/routine/hyper) for an explanation of `:$batch` and `:$degree`.
  
  # [In HyperSeq](#___top "go to top of document")[§](#(HyperSeq)_method_race "direct link")
  
  See primary documentation
  [in context](/type/HyperSeq#method_race)
  for **method race**.
  
  ```raku
  method race(HyperSeq:D:)
  ```
  
  Creates a [`RaceSeq`](/type/RaceSeq) object out of the current one.
  
  # [In RaceSeq](#___top "go to top of document")[§](#(RaceSeq)_method_race "direct link")
  
  See primary documentation
  [in context](/type/RaceSeq#method_race)
  for **method race**.
  
  ```raku
  method race(RaceSeq:D:)
  ```
  
  Returns the object.
  