File: leak.rb

package info (click to toggle)
ruby-async-pool 0.3.12-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 188 kB
  • sloc: ruby: 535; makefile: 4
file content (19 lines) | stat: -rwxr-xr-x 415 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env ruby
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2022, by Samuel Williams.

require "async"
require "async/redis"

Async do |task|
	c = Async::Redis::Client.new

	10_000.times do |i|
		c.ping "foo#{i}"
	end

	available = c.instance_variable_get("@pool").instance_variable_get("@available")
	puts "available size #{available.size}, unique #{available.uniq.size}"
end