Skip to content

v2.12.3: support PriorityBlockingQueue with ThreadPoolExecutor

Compare
Choose a tag to compare
@oldratlee oldratlee released this 18 Dec 13:37
· 289 commits to master since this release

Java support

Change Log

Caution

Version 2.12.3 🦎 is Deprecated! use version 2.12.5+ instead.

New Features

  • new API: TransmittableThreadLocal.withInitialAndCopier static method, javadoc
  • Support PriorityBlockingQueue with ThreadPoolExecutor
    Avoid ClassCastException(TtlRunnable cannot be cast to Comparable) problem for combination usage:
    (issues #330 #290 #178 submitted by @outh0527 @KevinQian @wangchongya)
    • use java.util.concurrent.PriorityBlockingQueue for java.util.concurrent.ThreadPoolExecutor
    • 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
    • Demo Code: TtlExecutorServiceWithPriorityBlockingQueueDemo

Improvements

  • fix: work-around ClassCircularityError
    (issues #278 #234 submitted by @linfan @kun1988)
  • upgrade dependencies/plugins

Java API Doc

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

Maven dependency

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