Print resource pools without the channel

Since the channel printer prints quite a lot of text.
This commit is contained in:
Christopher Baines 2025-01-06 19:22:50 +00:00
parent 97a3116b81
commit 0771a41fe0

View file

@ -20,6 +20,7 @@
(define-module (knots resource-pool) (define-module (knots resource-pool)
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
#:use-module (srfi srfi-9) #:use-module (srfi srfi-9)
#:use-module (srfi srfi-9 gnu)
#:use-module (ice-9 match) #:use-module (ice-9 match)
#:use-module (ice-9 exceptions) #:use-module (ice-9 exceptions)
#:use-module (fibers) #:use-module (fibers)
@ -52,6 +53,14 @@
(name resource-pool-name) (name resource-pool-name)
(channel resource-pool-channel)) (channel resource-pool-channel))
(set-record-type-printer!
<resource-pool>
(lambda (resource-pool port)
(display
(simple-format #f "#<resource-pool name: \"~A\">"
(resource-pool-name resource-pool))
port)))
(define* (make-resource-pool initializer max-size (define* (make-resource-pool initializer max-size
#:key (min-size max-size) #:key (min-size max-size)
(idle-seconds #f) (idle-seconds #f)