1. my class X::Invalid::Value { ... }
  2. # Configuration for hyper/race, controlling how we parallelize (number of
  3. # items at a time, and number of threads).
  4. my class HyperConfiguration {
  5. has int $.batch;
  6. has Int $.degree;
  7. submethod TWEAK(:$method) {
  8. nqp::if(
  9. $!batch <= 0,
  10. X::Invalid::Value.new(:$method,:name<batch>,:value($!batch)).throw,
  11. nqp::if(
  12. $!degree <= 0,
  13. X::Invalid::Value.new(:$method,:name<degree>,:value($!degree)).throw,
  14. Nil
  15. )
  16. )
  17. }
  18. }