Package Usage: go: github.com/go-playground/pool
Package pool implements a limited consumer goroutine or unlimited goroutine pool for easier goroutine handling and cancellation.
Features:
Pool v2 advantages over Pool v1:
Pool v3 advantages over Pool v2:
Important Information READ THIS!
important usage information
It is recommended that you cancel a pool or batch from the calling
function and not inside of the Unit of Work, it will work fine, however
because of the goroutine scheduler and context switching it may not
cancel as soon as if called from outside.
When Batching DO NOT FORGET TO CALL batch.QueueComplete(),
if you do the Batch WILL deadlock
It is your responsibility to call WorkUnit.IsCancelled() to check if it's cancelled
after a blocking operation like waiting for a connection from a pool. (optional)
both Limited Pool and Unlimited Pool have the same signatures and are completely interchangeable.
Per Unit Work
Batch Work
run with 1, 2, 4,8 and 16 cpu to show it scales well...16 is double the # of logical cores on this machine.
NOTE: Cancellation times CAN vary depending how busy your system is and how the goroutine scheduler is but
worse case I've seen is 1 second to cancel instead of 0ns
To put some of these benchmarks in perspective:
8 versions
Latest release: over 8 years ago
View more package details: https://packages.ecosyste.ms/registries/proxy.golang.org/packages/github.com/go-playground/pool
View more repository details: http://repos.ecosyste.ms/hosts/GitHub/repositories/go-playground%2Fpool
Dependent Repos 1
tauruswei/brilliance-ca
brilliance ca 组件,底层依赖 fabric bccspSize: 7.55 MB - Last synced: about 2 years ago - Pushed: over 3 years ago
