Handbook
Glossary
with-pooled-connection ( pool quot -- )
Connection pools
Prev:
return-connection ( conn pool -- )
Next:
make-connection ( pool -- conn )
Vocabulary
io
.
pools
Inputs
pool
a
pool
quot
a
quotation
with stack effect
( conn -- )
Outputs
None
Word description
Calls a quotation with a pooled connection on the stack. If the quotation returns successfully, the connection is returned to the pool; if the quotation throws an error, the connection is disposed of with
dispose
.
Definition
USING:
continuations
destructors
kernel
;
IN:
io.pools
:
with-pooled-connection
( pool quot -- )
[
[
acquire-connection
]
keep
]
dip
[
(with-pooled-connection)
]
[
]
[
2drop
dispose
]
cleanup
;
inline