Skip to main content

may_spawn

Function may_spawn 

Source
pub fn may_spawn(main_in_flight: bool, active: usize, queued: usize) -> bool
Expand description

新しいワーカーを起こしてよいかの判定(純粋関数)。

  • main_in_flight … メイン HTML の取得中か
  • active … 現在走っているワーカー総数
  • queued … そのキューに溜まっている件数

メイン HTML 取得中は新規に起こさない。 上限に達していても起こさない。 積むものが無ければ起こさない。