Allow specifying the resource-pool-channel
This commit is contained in:
parent
68cfbe0380
commit
1dca6d755e
1 changed files with 4 additions and 3 deletions
|
@ -786,7 +786,8 @@
|
||||||
(define* (call-with-resource-from-pool
|
(define* (call-with-resource-from-pool
|
||||||
pool proc #:key (timeout 'default)
|
pool proc #:key (timeout 'default)
|
||||||
(timeout-handler (resource-pool-default-timeout-handler))
|
(timeout-handler (resource-pool-default-timeout-handler))
|
||||||
(max-waiters 'default))
|
(max-waiters 'default)
|
||||||
|
(channel (resource-pool-channel pool)))
|
||||||
"Call PROC with a resource from POOL, blocking until a resource becomes
|
"Call PROC with a resource from POOL, blocking until a resource becomes
|
||||||
available. Return the resource once PROC has returned."
|
available. Return the resource once PROC has returned."
|
||||||
|
|
||||||
|
@ -810,7 +811,7 @@ available. Return the resource once PROC has returned."
|
||||||
(perform-operation
|
(perform-operation
|
||||||
(choice-operation
|
(choice-operation
|
||||||
(wrap-operation
|
(wrap-operation
|
||||||
(put-operation (resource-pool-channel pool)
|
(put-operation channel
|
||||||
(list 'checkout
|
(list 'checkout
|
||||||
reply
|
reply
|
||||||
(+ start-time
|
(+ start-time
|
||||||
|
@ -846,7 +847,7 @@ available. Return the resource once PROC has returned."
|
||||||
response))
|
response))
|
||||||
'timeout)))))
|
'timeout)))))
|
||||||
(let loop ((reply (make-channel)))
|
(let loop ((reply (make-channel)))
|
||||||
(put-message (resource-pool-channel pool)
|
(put-message channel
|
||||||
(list 'checkout
|
(list 'checkout
|
||||||
reply
|
reply
|
||||||
#f
|
#f
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue