Functions and records for a KeyedPool. A keyed pool contains one IObjPool instance per key usage: tcp connection pool per server where the key is the server host and port
Use the create-atom-keyed-obj-pool function to create the pool then use the kafka-clj.pool.api functions to poll, return and close the pool
Functions and records for a KeyedPool. A keyed pool contains one IObjPool instance per key usage: tcp connection pool per server where the key is the server host and port Use the create-atom-keyed-obj-pool function to create the pool then use the kafka-clj.pool.api functions to poll, return and close the pool
(add-keyed-pool ctx m-atom k pool-create-f)
Called from get-keyed-pool Add a pool keyed on k to m-atom pool-create-f: called (pool-create-f ctx k) should create an instance of IObjPool
Called from get-keyed-pool Add a pool keyed on k to m-atom pool-create-f: called (pool-create-f ctx k) should create an instance of IObjPool
(create-keyed-obj-pool ctx pool-create-f)
(create-keyed-obj-pool ctx value-create-f value-validate-f value-destroy-f)
ctx = :pool-limit int max objects each pool keyed can have
value-create-f is called to create a pool when required and is called (create-f ctx k) where k is the key used on the pool value-validate-f is called before returning a polled object, the validation is done outside the polling function such that it doesn't block other threads from polling this allows possibly blocking validtion not to hurt performance for other threads, called using (value-validate-f ctx k v) value-destroy-f invalid objects are destroyed and removed from the pool called using (value-destroy-f ctx k v)
pool-create-f will be called as (pool-create-f ctx k) where k is the key for the pool
ctx = :pool-limit int max objects each pool keyed can have value-create-f is called to create a pool when required and is called (create-f ctx k) where k is the key used on the pool value-validate-f is called before returning a polled object, the validation is done outside the polling function such that it doesn't block other threads from polling this allows possibly blocking validtion not to hurt performance for other threads, called using (value-validate-f ctx k v) value-destroy-f invalid objects are destroyed and removed from the pool called using (value-destroy-f ctx k v) pool-create-f will be called as (pool-create-f ctx k) where k is the key for the pool
(create-managed-keyed-obj-pool ctx keyed-obj-pool)
ctx = :idle-limit-ms the time an object can be idle till its removed permemantly from the pool 60 seconds :idle-check-freq-ms time to check for idle timeouts 60 seconds :ttl-ms time to live ms that a connection closed afterwards no matter if its being used or not, default 15 minutes
ctx = :idle-limit-ms the time an object can be idle till its removed permemantly from the pool 60 seconds :idle-check-freq-ms time to check for idle timeouts 60 seconds :ttl-ms time to live ms that a connection closed afterwards no matter if its being used or not, default 15 minutes
(get-keyed-pool ctx m-atom k pool-create-f)
Get a pool keyed on k, if the pool doesn't exist yet its created pool-create-f: called (pool-create-f ctx) should create an instance of IObjPool
Get a pool keyed on k, if the pool doesn't exist yet its created pool-create-f: called (pool-create-f ctx) should create an instance of IObjPool
(identity-f v)
Return a identity function that take any amount of arguments and always return v
Return a identity function that take any amount of arguments and always return v
(join-key k)
(keyed-pool-stats m-atom)
(remove-keyed-pool m-atom k)
(remove-keyed-pool-all m-atom)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close