File: count_open_pipes.rb

package info (click to toggle)
ruby-parallel 1.22.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 464 kB
  • sloc: ruby: 1,930; makefile: 4
file content (6 lines) | stat: -rw-r--r-- 221 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
# frozen_string_literal: true
require './spec/cases/helper'
count = ->(*) { `lsof -l | grep pipe | wc -l`.to_i }
start = count.call
results = Parallel.map(Array.new(20), in_processes: 20, &count)
puts results.max - start