异步转Mono
发表于|更新于
|浏览量:
小利不争,小忿不发,可以合众。——傅昭
今天分享一个异步方法转Mono的方式,利用reactor.core.publisher.Mono#create:
1 | return Mono.create(sink -> rtmClient.subscribe(channelName, options, new ResultCallback<Void>() { |
即可实现
相关推荐
2022-06-04
quartz连接池问题
心脏是一座有两间卧室的房子,一间住着痛苦,另一间住着欢乐,人不能笑得太响。否则笑声会吵醒隔壁房间的痛苦。——卡夫卡 之前写了篇quartz博客:https://VampireAchao.github.io/2021/01/24/quartz/ 这两天通过druid监控发现一些连接一直没有释放,以为是出现了链接池泄露 最后排查发现,quartz没有使用druid的连接池,因此导致连接池经常满 把这段配置注掉即可
2022-10-12
stream-core实现枚举校验
同一个美丽而聪慧的人相处,能使人紧张的神经放松,感情变得柔和——巴尔扎尔 引入依赖: 123456<!-- https://search.maven.org/artifact/io.github.vampireachao/stream-query --><dependency> <groupId>io.github.vampireachao</groupId> <artifactId>stream-core</artifactId> <version>1.1.12</version></dependency> 编写代码: 123456789101112131415161718192021222324252627@Testvoid test() { class User { public GenderEnum getGender() { return null; ...
2023-02-14
freemarker遍历集合
读而未晓则思,思而未晓则读——朱熹 官方文档:https://freemarker.apache.org/docs/dgui_quickstart_template.html 语法如下:<#list sequence as loopVariable>repeatThis</#list> 例如模板如下: 123456<p>We have these animals:<table border=1> <#list animals as animal> <tr><td>${animal.name}<td>${animal.price} Euros </#list></table> 就会生成 123456<p>We have these animals:<table border=1> <tr><td>mouse<td>50 Euros <...
2023-05-03
为shenyu的PortUtils.findPort添加单元测试
爱好自由是人的天性,但往往过度而陷于放纵。斯宾诺莎 今天为shenyu的shenyu-client-core模块下添加了PortUtils.findPort的test case: https://github.com/apache/shenyu/pull/4604 对应的代码如下: 123456789101112131415161718192021222324252627282930313233343536373839404142/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Ve...
2023-02-15
bean-searcher内嵌参数
凡事有私心的人,虚荣心强的人,一切以我为中心的人才最爱听拍马屁的奉承话、甜言蜜语,其中一定包含着辛辣——席勒 文档链接 这里的内嵌参数中的一种,拼接参数可以让我们传入自定义的sql,更加的灵活 例如嵌入到@SearchBean.tables里 123456789101112@SearchBean( tables = ":table:" // 参数 table 由检索时动态指定,这在分表检索时非常有用) public class Order { @DbField("id") private long id; @DbField("order_no") private String orderNo;} 又或者是groupBy里 12345678910@SearchBean( tables = "student", groupBy = ":groupBy:" // 动态指定分组条件)...
2021-01-24
quartz
天下熙熙,皆为利来;天下攘攘,皆为利往。——《史记》 Quartz Job Scheduling Library是什么?Quartz是功能强大的开源作业调度库,几乎可以集成到任何Java应用程序中-从最小的独立应用程序到最大的电子商务系统。Quartz可用于创建简单或复杂的计划,以执行数以万计,数以万计的工作。任务定义为标准Java组件的作业,它们实际上可以执行您可以对其执行的任何编程操作。Quartz Scheduler包含许多企业级功能,例如对JTA事务和集群的支持。 Quartz是免费使用的,并根据Apache 2.0许可获得许可。 简单来说,就是一调度框架,用来干动态定时任务的 quartz官方文档 quartzAPI文档 在springboot中使用quartz 导入依赖 12345<!-- quartz --><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-qu...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog