Handbook
Glossary
acquire-connection ( pool -- conn )
Connection pools
Prev:
with-pool ( pool quot -- )
Next:
return-connection ( conn pool -- )
Vocabulary
io
.
pools
Inputs
pool
a
pool
Outputs
conn
a connection
Word description
Outputs a connection from the pool, preferring to take an existing one, creating a new one with
make-connection
if the pool is empty.
Definition
USING:
accessors
kernel
sequences
;
IN:
io.pools
:
acquire-connection
( pool -- conn )
dup
check-pool
[
dup
connections>>
empty?
]
[
dup
new-connection
]
while
connections>>
pop
;