首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏leehao

    Java异步子线程读取主线程参数的若干好玩场景

    100), Thread::new, new ThreadPoolExecutor.AbortPolicy()); @GetMapping("/asyncTest ") public String asyncTest(HttpServletRequest request) { request.setAttribute("key1","value1 @GetMapping("/asyncTest") public String asyncTest(HttpServletRequest request) { request.setAttribute @GetMapping("/asyncTest") public String asyncTest(HttpServletRequest request) { request.setAttribute @GetMapping("/asyncTest") public String asyncTest(HttpServletRequest request) { request.setAttribute

    37810编辑于 2025-02-11
  • 来自专栏Kiba518

    C#语法——await与async的正确打开方式

    目的是为了让这个方法这样被调用 await AsyncTest(),但直接这样调用,并不会开启线程,那这样费劲的修饰是不是就没什么意义了呢。 当然不是,那什么时候会让 await AsyncTest()有意义呢? 我们接着往下看,修改AsyncTest如下。 然后,此时再调用await AsyncTest(),你会神奇的发现,依然没有卵用。。。 Excute方法正常执行,而AsyncTest内运行的线程,自己执行自己的。 但是,好像await AsyncTest();还是没启作用。没错,事实就是,他真的不会起作用。。。 那么怎么才能让他起作用呢? 如图,这样写await AsyncTest();就起作用了。 所以,还是那句话,await等待的是线程,不是函数。 但在图里,我们发现很奇怪的一点,结束Excute也是线程3,而不是线程1。

    1.4K30发布于 2018-08-23
  • 来自专栏海加尔金鹰的专栏

    springboot之线程池ThreadPoolTaskExecutor以及@Async异步注解

    +name); } } 第三步:测试类进行测试验证 @Autowired AsyncTest asyncTest; @Test void contextLoads () throws InterruptedException { asyncTest.hello("afsasfasf"); //一定要休眠 不然主线程关闭了,子线程还没有启动 3.003 seconds (JVM running for 5.342) INFO 2276 --- [ task-1] c.h.s.threadpool.threadpool.AsyncTest () throws InterruptedException { asyncTest.hello("async注解创建"); threadPoolTaskExecutor.submit 即修改测试类如下: @Autowired AsyncTest asyncTest; @Autowired ThreadPoolTaskExecutor poolExecutor

    38.8K116发布于 2020-06-08
  • 来自专栏JavaScript全栈

    每日两题 T7

    最后看看 babel es8 编译 async/await 的结果 async function asyncTest() { const ret = await asyncFunction(); } resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function asyncTest () { return _asyncTest.apply(this, arguments); } function _asyncTest() { _asyncTest = _asyncToGenerator (function*() { const ret = yield asyncFunction(); }); return _asyncTest.apply(this, arguments

    54530发布于 2020-07-17
  • 来自专栏IT笔记分享

    spring boot使用@Async异步任务

    c.e.async.service.AsyncTestService : 耗时:0 2018-07-17 11:32:05.394 INFO 5232 --- [cTaskExecutor-3] com.example.async.service.AsyncTest : 这里是异步方法 2018-07-17 11:32:05.394 INFO 5232 --- [cTaskExecutor-3] com.example.async.service.AsyncTest : 传过来的名字是:ling 2018-07-17 11:32:05.394 INFO 5232 --- [cTaskExecutor-3] com.example.async.service.AsyncTest 调用异步的方法 public String noReturn(String name){ Long start = System.currentTimeMillis(); asyncTest.noReturnAsync 具体参见:Spring Boot使用@Async实现异步调用github项目地址:https://github.com/lgsdaredevil/asyncTest

    89510发布于 2019-07-15
  • 来自专栏快乐阿超

    CompletableFuture事务处理

    org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import java.util.Objects; import java.util.concurrent.CompletableFuture; /** * AsyncTest * * @author VampireAchao * @since 2022/12/6 */ @SpringBootTest class AsyncTest { @Test org.springframework.transaction.support.TransactionTemplate; import java.util.Objects; import java.util.concurrent.CompletableFuture; /** * AsyncTest * * @author VampireAchao * @since 2022/12/6 */ @SpringBootTest class AsyncTest { @Test

    1.9K60编辑于 2022-12-11
  • 来自专栏全栈程序员必看

    windows_清空listview中的数据

    bindScriptOption.CamelCaseJavascriptNames = false; //默认使用驼峰结构,那么对应的html里面的js也要用驼峰形式命名 var asyncTest = new AsyncTest(); webBrowser.RegisterAsyncJsObject("AsyncTest", asyncTest, bindScriptOption

    2.1K90编辑于 2022-09-28
  • 来自专栏.Net、.Net Core 、Docker

    .Net异步编程详解入门

    url = "http://www.cninnovation.com/"; static void Main(string[] args) { AsyncTest (); } public static void AsyncTest() { Console.WriteLine(nameof( AsyncTest)); using (var client=new WebClient()) { string content (); } public static void AsyncTest() { Console.WriteLine(nameof(AsyncTest (); } public static void AsyncTest() { Console.WriteLine(nameof(AsyncTest

    94021发布于 2019-09-11
  • 来自专栏Java技术栈

    Spring开启方法异步执行

    AsyncResult<String>("javastack"); } } 测试代码 @RunWith(SpringRunner.class) @SpringBootTest public class AsyncTest { private final static Logger log = LoggerFactory.getLogger(AsyncTest.class); @Autowired

    1.6K40发布于 2018-03-30
  • 来自专栏用户4352451的专栏

    SpringBoot 2.X中的@Async和Java8中的completableFuture的使用比较

    CompleteTableTuture demo /** * @author yuanxindong * @date: 2020/7/31 16:53 */ @Service public class AsyncTest completableFuture的使用demo /** * @author yuanxindong * @date: 2020/7/31 16:53 */ @Service public class AsyncTest

    3.1K30发布于 2020-08-26
  • 来自专栏程序员的诗和远方

    30分钟QUnit入门教程

    function(){ console.log("To click body") $body.trigger( "click" ); }, 1000) }); QUnit还提供了QUnit.asyncTest QUnit.asyncTest( "a test 2", function( assert ) { var $body = $( "body" ); $body.on( "click", function return function () { --count || QUnit.start(); }; } // an async test that expects 2 assertions QUnit.asyncTest QUnit.asyncTest中第二个参数"2"类似assert.expect( 2 )中的“2”。

    1.7K90发布于 2018-05-02
  • 来自专栏前端专享

    [前端面试]每日一题

    最后看看 babel es8 编译 async/await 的结果 async function asyncTest() { const ret = await asyncFunction(); } resolve, reject, _next, _throw, 'throw', err); } _next(undefined); }); }; } function asyncTest () { return _asyncTest.apply(this, arguments); } function _asyncTest() { _asyncTest = _asyncToGenerator (function*() { const ret = yield asyncFunction(); }); return _asyncTest.apply(this, arguments

    1.5K20发布于 2021-11-15
  • 来自专栏SeanCheney的专栏

    Awesome Asyncio 《碉堡的Asyncio·中文版》Awesome-Asyncio-CN

    asynctest - 一个增强标准 unittest 包的测试库。 pytest-asyncio - 支持 Asyncio 的 Pytest 库。

    3K40发布于 2018-08-16
  • 来自专栏青梅煮码

    vue3.0新特性

    --在父组件中使用该组件 --> <Suspense> <template #default> <AsyncTest /> </template> <!

    57320编辑于 2023-02-18
  • 来自专栏cnblogs

    async 和 await 之异步编程的学习

    class AsyncTest{ //simple example async run(){ //按照顺序等待后输出 let one = await this.output

    1.3K80发布于 2018-01-17
  • 来自专栏六脉神剑的程序人生

    项目中发现了一个新的玩意WebAsyncTask

    { //业务处理 使用Future返回异步调用结果 return new AsyncResult<>("任务一完成"); 在Spring中运用 Async注解 需要注意几点: AsyncTest.java

    81420编辑于 2022-07-29
  • 来自专栏java相关

    SpringBoot中Async异步方法和定时任务介绍

    AsyncApplicationTests { @Autowired private AsyncTaskService asyncTaskService; @Test public void asyncTest

    2.3K40发布于 2018-07-03
  • 来自专栏服务端技术杂谈

    采用线程池进行异步任务处理

    SpringBootTest(classes = SpringbootApplication.class)@RunWith(SpringJUnit4ClassRunner.class)@Slf4jpublic class AsyncTest

    3.5K40发布于 2018-07-23
  • 来自专栏javascript趣味编程

    [机器学习]基于tensorflow.js的k-means聚类分析

    Function kmeans.Dispose(); predictions.dispose(); dataset.dispose(); }); } async function AsyncTest ", tf.memory()); kmeans.Dispose(); predictions.dispose(); dataset.dispose(); } SyncTest(); AsyncTest

    1.5K30发布于 2020-12-02
  • 来自专栏QGS星球

    手搭手Springboot3整合RocketMQ2.3

    就代表消费失败,会重新入队 (根据yml配置) System.out.println("接收到消息:"+new String(messages.getBody())); }}发送异步消息生产者@Testvoid asyncTest

    2K10编辑于 2024-04-22
领券