Package com.esotericsoftware.kryo.pool
Class KryoPoolQueueImpl
java.lang.Object
com.esotericsoftware.kryo.pool.KryoPoolQueueImpl
- All Implemented Interfaces:
KryoPool
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.esotericsoftware.kryo.pool.KryoPool
KryoPool.Builder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionborrow()
Takes aKryo
instance from the pool or creates a new one (using the factory) if the pool is empty.void
clear()
void
Returns the givenKryo
instance to the pool.<T> T
run
(KryoCallback<T> callback) Runs the providedKryoCallback
with aKryo
instance from the pool (borrow/release aroundKryoCallback.execute(Kryo)
).int
size()
-
Field Details
-
queue
-
factory
-
-
Constructor Details
-
KryoPoolQueueImpl
KryoPoolQueueImpl(KryoFactory factory, Queue<Kryo> queue)
-
-
Method Details
-
size
public int size() -
borrow
Description copied from interface:KryoPool
Takes aKryo
instance from the pool or creates a new one (using the factory) if the pool is empty. -
release
Description copied from interface:KryoPool
Returns the givenKryo
instance to the pool. -
run
Description copied from interface:KryoPool
Runs the providedKryoCallback
with aKryo
instance from the pool (borrow/release aroundKryoCallback.execute(Kryo)
). -
clear
public void clear()
-