Go Commons Pool 1.0 released

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

Go Commons pool is a universal go language object pooling, rewritten based on the Java version of the Apache Commons pool. Go Commons Pool implements the main features of the Java version, overwriting most of the Java version of the test case, testing coverage of 90%, performance test results and Java version of the similar, already can be used in production environment, so release 1.0 version.

Go Commons pool retains the main features of the Java version, including:

  1. Custom Pooledobjectfactory.
  2. Rich set options to precisely control the life cycle of an object. See Objectpoolconfig for details.
    • Whether the object pool is LIFO (last-in-first-out) or FIFO (first-out)
    • Capacity control of the object pool
    • Validation configuration for Object Pool objects
    • Whether the object is blocked and the maximum wait time configuration is obtained
    • Object Pool Object recycle mechanism configuration (Support background timer task detection recycle)
    • Discard mechanism configuration for object pool objects (primarily used to prevent object pool object from being returned after loan, resulting in object disclosure)

However, the following Apache Commons pool features are not included:

  1. Keyedobjectpool implementation
  2. Proxiedobjectpool implementation
  3. Statistical functions of the object pool

Go Commons pool is the main application scenario is a variety of connection pools, the current go under the various caches or databases (such as redis/memcached) have implemented a less well-functioning connection pool (such as missing timeout settings, etc.), if the Go Commons The pool can support richer settings.

Summary of the concurrency problems of Go language encountered in the rewriting process can be found in the blog Golang multithreaded programming problem summary.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.