Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿啄debugIT
transmittable-thread-local
提交
b423da81
T
transmittable-thread-local
项目概览
阿啄debugIT
/
transmittable-thread-local
与 Fork 源项目一致
从无法访问的项目Fork
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
transmittable-thread-local
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b423da81
编写于
8月 24, 2019
作者:
oldratlee
🔥
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add jdk 13 in travis-ci
上级
455befa7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
71 addition
and
21 deletion
+71
-21
.travis.yml
.travis.yml
+4
-0
README-EN.md
README-EN.md
+1
-1
README.md
README.md
+1
-1
scripts/integration-test.sh
scripts/integration-test.sh
+10
-0
scripts/travis-prepare.sh
scripts/travis-prepare.sh
+55
-19
未找到文件。
.travis.yml
浏览文件 @
b423da81
...
@@ -75,6 +75,10 @@ script:
...
@@ -75,6 +75,10 @@ script:
-
switch_to_open_jdk12
-
switch_to_open_jdk12
-
./scripts/run-junit.sh skipClean
-
./scripts/run-junit.sh skipClean
-
./scripts/run-agent-test.sh skipClean
-
./scripts/run-agent-test.sh skipClean
# open jdk 12
-
switch_to_open_jdk13
-
./scripts/run-junit.sh skipClean
-
./scripts/run-agent-test.sh skipClean
after_success
:
after_success
:
# codecov
# codecov
...
...
README-EN.md
浏览文件 @
b423da81
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
👉 The missing Java™ std lib(simple & 0-dependency) for framework/middleware,
👉 The missing Java™ std lib(simple & 0-dependency) for framework/middleware,
provide an enhanced
`InheritableThreadLocal`
that transmits
`ThreadLocal`
value between threads even using thread pooling components.
provide an enhanced
`InheritableThreadLocal`
that transmits
`ThreadLocal`
value between threads even using thread pooling components.
Support
`Java`
12/11/10/9/8/7/6.
Support
`Java`
1
3/1
2/11/10/9/8/7/6.
Class
[
`InheritableThreadLocal`
](
https://docs.oracle.com/javase/10/docs/api/java/lang/InheritableThreadLocal.html
)
in
`JDK`
Class
[
`InheritableThreadLocal`
](
https://docs.oracle.com/javase/10/docs/api/java/lang/InheritableThreadLocal.html
)
in
`JDK`
can transmit value to child thread from parent thread.
can transmit value to child thread from parent thread.
...
...
README.md
浏览文件 @
b423da81
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
# 🔧 功能
# 🔧 功能
👉 在使用线程池等会池化复用线程的组件情况下,提供
`ThreadLocal`
值的传递功能,解决异步执行时上下文传递的问题。
👉 在使用线程池等会池化复用线程的组件情况下,提供
`ThreadLocal`
值的传递功能,解决异步执行时上下文传递的问题。
一个
`Java`
标准库本应为框架/中间件设施开发提供的标配能力,本库功能聚焦 & 0依赖,支持
`Java`
12/11/10/9/8/7/6。
一个
`Java`
标准库本应为框架/中间件设施开发提供的标配能力,本库功能聚焦 & 0依赖,支持
`Java`
1
3/1
2/11/10/9/8/7/6。
`JDK`
的
[
`InheritableThreadLocal`
](
https://docs.oracle.com/javase/10/docs/api/java/lang/InheritableThreadLocal.html
)
类可以完成父线程到子线程的值传递。但对于使用线程池等会池化复用线程的组件的情况,线程由线程池创建好,并且线程是池化起来反复使用的;这时父子线程关系的
`ThreadLocal`
值传递已经没有意义,应用需要的实际上是把
**任务提交给线程池时**
的
`ThreadLocal`
值传递到
**任务执行时**
。
`JDK`
的
[
`InheritableThreadLocal`
](
https://docs.oracle.com/javase/10/docs/api/java/lang/InheritableThreadLocal.html
)
类可以完成父线程到子线程的值传递。但对于使用线程池等会池化复用线程的组件的情况,线程由线程池创建好,并且线程是池化起来反复使用的;这时父子线程关系的
`ThreadLocal`
值传递已经没有意义,应用需要的实际上是把
**任务提交给线程池时**
的
`ThreadLocal`
值传递到
**任务执行时**
。
...
...
scripts/integration-test.sh
浏览文件 @
b423da81
...
@@ -87,3 +87,13 @@ if [ -n "$JAVA12_HOME" ]; then
...
@@ -87,3 +87,13 @@ if [ -n "$JAVA12_HOME" ]; then
else
else
headInfo
"skip Java 12 test"
headInfo
"skip Java 12 test"
fi
fi
# Java 13
if
[
-n
"
$JAVA13_HOME
"
]
;
then
headInfo
"test with Java 13"
export
JAVA_HOME
=
"
${
JAVA13_HOME
}
"
runCmd ./scripts/run-junit.sh skipClean
runCmd ./scripts/run-agent-test.sh skipClean
else
headInfo
"skip Java 13 test"
fi
scripts/travis-prepare.sh
浏览文件 @
b423da81
...
@@ -7,37 +7,73 @@ if [ ! -f "$install_jdk_bin" ]; then
...
@@ -7,37 +7,73 @@ if [ ! -f "$install_jdk_bin" ]; then
chmod
+x
"
$install_jdk_bin
"
chmod
+x
"
$install_jdk_bin
"
fi
fi
switch_to_open_jdk9
()
{
readonly nl
=
$'
\n
'
# new line
export
JAVA_HOME
=
$HOME
/.jdk/openjdk9
readonly
ec
=
$'
\0
33'
# escape char
readonly
eend
=
$'
\0
33[0m'
# escape end
colorEcho
()
{
local
color
=
$1
shift
# if stdout is console, turn on color output.
[
-t
1
]
&&
echo
"
$ec
[1;
${
color
}
m
$@$eend
"
||
echo
"
$@
"
}
blueEcho
()
{
colorEcho 36
"
$@
"
}
runCmd
()
{
blueEcho
"Run under work directory
$PWD
:
$nl$@
"
time
"
$@
"
}
swith_jdk
()
{
((
$#
!=
2
))
&&
{
echo
"Error:
$@
, only need version and license"
exit
2
}
local
version
=
"
$1
"
local
license
=
"
$2
"
case
"
$license
"
in
GPL
)
export
JAVA_HOME
=
$HOME
/.jdk/openjdk
$version
;;
BCL
)
export
JAVA_HOME
=
$HOME
/.jdk/oraclejdk
$version
;;
*
)
echo
"Error:
$@
, wrong license!"
exit
2
;;
esac
if
[
!
-d
"
$JAVA_HOME
"
]
;
then
if
[
!
-d
"
$JAVA_HOME
"
]
;
then
"
$install_jdk_bin
"
--feature
9
--license
GPL
--target
"
$JAVA_HOME
"
runCmd
"
$install_jdk_bin
"
--feature
$version
--license
$license
--target
"
$JAVA_HOME
"
fi
fi
}
}
switch_to_open_jdk9
()
{
swith_jdk 9 GPL
}
switch_to_oracle_jdk11
()
{
switch_to_oracle_jdk11
()
{
export
JAVA_HOME
=
$HOME
/.jdk/oraclejdk11
swith_jdk 11 BCL
if
[
!
-d
"
$JAVA_HOME
"
]
;
then
"
$install_jdk_bin
"
--feature
11
--license
BCL
--target
"
$JAVA_HOME
"
fi
}
}
switch_to_open_jdk10
()
{
switch_to_open_jdk10
()
{
export
JAVA_HOME
=
$HOME
/.jdk/openjdk10
swith_jdk 10 GPL
if
[
!
-d
"
$JAVA_HOME
"
]
;
then
"
$install_jdk_bin
"
--feature
10
--license
GPL
--target
"
$JAVA_HOME
"
fi
}
}
switch_to_open_jdk11
()
{
switch_to_open_jdk11
()
{
export
JAVA_HOME
=
$HOME
/.jdk/openjdk11
swith_jdk 11 GPL
if
[
!
-d
"
$JAVA_HOME
"
]
;
then
"
$install_jdk_bin
"
--feature
11
--license
GPL
--target
"
$JAVA_HOME
"
fi
}
}
switch_to_open_jdk12
()
{
switch_to_open_jdk12
()
{
export
JAVA_HOME
=
$HOME
/.jdk/openjdk12
swith_jdk 12 GPL
if
[
!
-d
"
$JAVA_HOME
"
]
;
then
}
"
$install_jdk_bin
"
--feature
12
--license
GPL
--target
"
$JAVA_HOME
"
fi
switch_to_open_jdk13
()
{
swith_jdk 13 GPL
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录