Skip to content

v2.12.3-RC1: support PriorityBlockingQueue with ThreadPoolExecutor

Pre-release
Pre-release
Compare
Choose a tag to compare
@oldratlee oldratlee released this 03 Dec 11:21
· 289 commits to master since this release

Java support

Change Log

New Features

Support PriorityBlockingQueue with ThreadPoolExecutor.
Avoid ClassCastException(TtlRunnable cannot be cast to Comparable) problem for combination usage:

  • use java.util.concurrent.PriorityBlockingQueue for java.util.concurrent.ThreadPoolExecutor ThreadPoolExecutor
  • use TTL: API or Agent(TtlExecutorTransformlet)

  • new APIs
    • com.alibaba.ttl.threadpool.TtlExecutors#getTtlRunnableUnwrapComparator, javadoc
    • com.alibaba.ttl.threadpool.TtlExecutors#getTtlRunnableUnwrapComparatorForComparableRunnable, javadoc
  • new TTL Transformlet: com.alibaba.ttl.threadpool.agent.internal.transformlet.impl.TtlPriorityBlockingQueueTransformlet

Java API Doc

https://alibaba.github.io/transmittable-thread-local/apidocs/2.12.3-RC1/index.html

Maven dependency

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>transmittable-thread-local</artifactId>
    <version>2.12.3-RC1</version>
</dependency>