Handbook
Glossary
return-connection ( conn pool -- )
Connection pools
Prev:
acquire-connection ( pool -- conn )
Next:
with-pooled-connection ( pool quot -- )
Vocabulary
io
.
pools
Inputs
conn
a connection
pool
a
pool
Outputs
None
Word description
Returns a connection to the pool. If the pool has been disposed of or its idle connection limit has been reached, disposes of the connection instead.
Definition
USING:
accessors
destructors
kernel
math
sequences
;
IN:
io.pools
:
return-connection
( conn pool -- )
dup
disposed>>
[
drop
dispose
]
[
dup
check-pool
dup
max-idle>>
[
over
connections>>
length
<=
]
[
f
]
if*
[
drop
dispose
]
[
connections>>
push
]
if
]
if
;