• 实战:10 种实现延迟任务的方法,附代码!


    不用谢我,送人玫瑰,手有余香。相信接下来的内容一定不会让你失望,因为它将是目前市面上最好的关于“延迟任务”的文章,这也一直是我写作追求的目标,让我的每一篇文章都比市面上的好那么一点点。

    好了,话不多说,直接进入今天的主题,本文的主要内容如下图所示:

    什么是延迟任务?

    顾明思议,我们把需要延迟执行的任务叫做延迟任务

    延迟任务的使用场景有以下这些:

    1. 红包 24 小时未被查收,需要延迟执退还业务;

    2. 每个月账单日,需要给用户发送当月的对账单;

    3. 订单下单之后 30 分钟后,用户如果没有付钱,系统需要自动取消订单。

    等事件都需要使用延迟任务。

    延迟任务实现思路分析

    延迟任务实现的关键是在某个时间节点执行某个任务。基于这个信息我们可以想到实现延迟任务的手段有以下两个:

    1. 自己手写一个“死循环”一直判断当前时间节点有没有要执行的任务;

    2. 借助 JDK 或者第三方提供的工具类来实现延迟任务。

    而通过 JDK 实现延迟任务我们能想到的关键词是:DelayQueue、ScheduledExecutorService,而第三方提供的延迟任务执行方法就有很多了,例如:Redis、Netty、MQ 等手段。

    延迟任务实现

    下面我们将结合代码来讲解每种延迟任务的具体实现。

    1.无限循环实现延迟任务

    此方式我们需要开启一个无限循环一直扫描任务,然后使用一个 Map 集合用来存储任务和延迟执行的时间,实现代码如下:

    1. import java.time.Instant;
    2. import java.time.LocalDateTime;
    3. import java.util.HashMap;
    4. import java.util.Iterator;
    5. import java.util.Map;
    6. /**
    7.  * 延迟任务执行方法汇总
    8.  */
    9. public class DelayTaskExample {
    10.     // 存放定时任务
    11.     private static Map<StringLong> _TaskMap = new HashMap<>();
    12.     public static void main(String[] args) {
    13.         System.out.println("程序启动时间:" + LocalDateTime.now());
    14.         // 添加定时任务
    15.         _TaskMap.put("task-1"Instant.now().plusSeconds(3).toEpochMilli()); // 延迟 3s
    16.         // 调用无限循环实现延迟任务
    17.         loopTask();
    18.     }
    19.     /**
    20.      * 无限循环实现延迟任务
    21.      */
    22.     public static void loopTask() {
    23.         Long itemLong = 0L;
    24.         while (true) {
    25.             Iterator it = _TaskMap.entrySet().iterator();
    26.             while (it.hasNext()) {
    27.                 Map.Entry entry = (Map.Entry) it.next();
    28.                 itemLong = (Long) entry.getValue();
    29.                 // 有任务需要执行
    30.                 if (Instant.now().toEpochMilli() >= itemLong) {
    31.                     // 延迟任务,业务逻辑执行
    32.                     System.out.println("执行任务:" + entry.getKey() +
    33.                             " ,执行时间:" + LocalDateTime.now());
    34.                     // 删除任务
    35.                     _TaskMap.remove(entry.getKey());
    36.                 }
    37.             }
    38.         }
    39.     }
    40. }

    以上程序执行的结果为:

    程序启动时间:2020-04-12T18:51:28.188

    执行任务:task-1 ,执行时间:2020-04-12T18:51:31.189

    可以看出任务延迟了 3s 钟执行了,符合我们的预期。

    2.Java API 实现延迟任务

    Java API 提供了两种实现延迟任务的方法:DelayQueue 和 ScheduledExecutorService。

    ① ScheduledExecutorService 实现延迟任务

    我们可以使用 ScheduledExecutorService 来以固定的频率一直执行任务,实现代码如下:

    1. public class DelayTaskExample {
    2.     public static void main(String[] args) {
    3.         System.out.println("程序启动时间:" + LocalDateTime.now());
    4.         scheduledExecutorServiceTask();
    5.     }
    6.     /**
    7.      * ScheduledExecutorService 实现固定频率一直循环执行任务
    8.      */
    9.     public static void scheduledExecutorServiceTask() {
    10.         ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
    11.         executor.scheduleWithFixedDelay(
    12.                 new Runnable() {
    13.                     @Override
    14.                     public void run() {
    15.                         // 执行任务的业务代码
    16.                         System.out.println("执行任务" +
    17.                                 " ,执行时间:" + LocalDateTime.now());
    18.                     }
    19.                 },
    20.                 2// 初次执行间隔
    21.                 2// 2s 执行一次
    22.                 TimeUnit.SECONDS);
    23.     }
    24. }

    以上程序执行的结果为:

    程序启动时间:2020-04-12T21:28:10.416

    执行任务 ,执行时间:2020-04-12T21:28:12.421

    执行任务 ,执行时间:2020-04-12T21:28:14.422

    ......

    可以看出使用 ScheduledExecutorService#scheduleWithFixedDelay(...) 方法之后,会以某个频率一直循环执行延迟任务。

    ② DelayQueue 实现延迟任务

    DelayQueue 是一个支持延时获取元素的无界阻塞队列,队列中的元素必须实现 Delayed 接口,并重写 getDelay(TimeUnit) 和 compareTo(Delayed) 方法,DelayQueue 实现延迟队列的完整代码如下:

    1. public class DelayTest {
    2.     public static void main(String[] args) throws InterruptedException {
    3.         DelayQueue delayQueue = new DelayQueue();
    4.         // 添加延迟任务
    5.         delayQueue.put(new DelayElement(1000));
    6.         delayQueue.put(new DelayElement(3000));
    7.         delayQueue.put(new DelayElement(5000));
    8.         System.out.println("开始时间:" +  DateFormat.getDateTimeInstance().format(new Date()));
    9.         while (!delayQueue.isEmpty()){
    10.             // 执行延迟任务
    11.             System.out.println(delayQueue.take());
    12.         }
    13.         System.out.println("结束时间:" +  DateFormat.getDateTimeInstance().format(new Date()));
    14.     }
    15.     static class DelayElement implements Delayed {
    16.         // 延迟截止时间(单面:毫秒)
    17.         long delayTime = System.currentTimeMillis();
    18.         public DelayElement(long delayTime) {
    19.             this.delayTime = (this.delayTime + delayTime);
    20.         }
    21.         @Override
    22.         // 获取剩余时间
    23.         public long getDelay(TimeUnit unit) {
    24.             return unit.convert(delayTime - System.currentTimeMillis(), TimeUnit.MILLISECONDS);
    25.         }
    26.         @Override
    27.         // 队列里元素的排序依据
    28.         public int compareTo(Delayed o) {
    29.             if (this.getDelay(TimeUnit.MILLISECONDS) > o.getDelay(TimeUnit.MILLISECONDS)) {
    30.                 return 1;
    31.             } else if (this.getDelay(TimeUnit.MILLISECONDS) < o.getDelay(TimeUnit.MILLISECONDS)) {
    32.                 return -1;
    33.             } else {
    34.                 return 0;
    35.             }
    36.         }
    37.         @Override
    38.         public String toString() {
    39.             return DateFormat.getDateTimeInstance().format(new Date(delayTime));
    40.         }
    41.     }
    42. }

    以上程序执行的结果为:

    开始时间:2020-4-12 20:40:38

    2020-4-12 20:40:39 

    2020-4-12 20:40:41 

    2020-4-12 20:40:43 

    结束时间:2020-4-12 20:40:43

    3.Redis 实现延迟任务

    使用 Redis 实现延迟任务的方法大体可分为两类:通过 zset 数据判断的方式,和通过键空间通知的方式

    ① 通过数据判断的方式

    我们借助 zset 数据类型,把延迟任务存储在此数据集合中,然后在开启一个无线循环查询当前时间的所有任务进行消费,实现代码如下(需要借助 Jedis 框架):

    1. import redis.clients.jedis.Jedis;
    2. import utils.JedisUtils;
    3. import java.time.Instant;
    4. import java.util.Set;
    5. public class DelayQueueExample {
    6.     // zset key
    7.     private static final String _KEY = "myDelayQueue";
    8.     
    9.     public static void main(String[] args) throws InterruptedException {
    10.         Jedis jedis = JedisUtils.getJedis();
    11.         // 延迟 30s 执行(30s 后的时间)
    12.         long delayTime = Instant.now().plusSeconds(30).getEpochSecond();
    13.         jedis.zadd(_KEY, delayTime, "order_1");
    14.         // 继续添加测试数据
    15.         jedis.zadd(_KEY, Instant.now().plusSeconds(2).getEpochSecond(), "order_2");
    16.         jedis.zadd(_KEY, Instant.now().plusSeconds(2).getEpochSecond(), "order_3");
    17.         jedis.zadd(_KEY, Instant.now().plusSeconds(7).getEpochSecond(), "order_4");
    18.         jedis.zadd(_KEY, Instant.now().plusSeconds(10).getEpochSecond(), "order_5");
    19.         // 开启延迟队列
    20.         doDelayQueue(jedis);
    21.     }
    22.     /**
    23.      * 延迟队列消费
    24.      * @param jedis Redis 客户端
    25.      */
    26.     public static void doDelayQueue(Jedis jedis) throws InterruptedException {
    27.         while (true) {
    28.             // 当前时间
    29.             Instant nowInstant = Instant.now();
    30.             long lastSecond = nowInstant.plusSeconds(-1).getEpochSecond(); // 上一秒时间
    31.             long nowSecond = nowInstant.getEpochSecond();
    32.             // 查询当前时间的所有任务
    33.             Set data = jedis.zrangeByScore(_KEY, lastSecond, nowSecond);
    34.             for (String item : data) {
    35.                 // 消费任务
    36.                 System.out.println("消费:" + item);
    37.             }
    38.             // 删除已经执行的任务
    39.             jedis.zremrangeByScore(_KEY, lastSecond, nowSecond);
    40.             Thread.sleep(1000); // 每秒轮询一次
    41.         }
    42.     }
    43. }

    ② 通过键空间通知

    默认情况下 Redis 服务器端是不开启键空间通知的,需要我们通过 config set notify-keyspace-events Ex 的命令手动开启,开启键空间通知后,我们就可以拿到每个键值过期的事件,我们利用这个机制实现了给每个人开启一个定时任务的功能,实现代码如下:

    1. import redis.clients.jedis.Jedis;
    2. import redis.clients.jedis.JedisPubSub;
    3. import utils.JedisUtils;
    4. public class TaskExample {
    5.     public static final String _TOPIC = "__keyevent@0__:expired"// 订阅频道名称
    6.     public static void main(String[] args) {
    7.         Jedis jedis = JedisUtils.getJedis();
    8.         // 执行定时任务
    9.         doTask(jedis);
    10.     }
    11.     /**
    12.      * 订阅过期消息,执行定时任务
    13.      * @param jedis Redis 客户端
    14.      */
    15.     public static void doTask(Jedis jedis) {
    16.         // 订阅过期消息
    17.         jedis.psubscribe(new JedisPubSub() {
    18.             @Override
    19.             public void onPMessage(String pattern, String channel, String message) {
    20.                 // 接收到消息,执行定时任务
    21.                 System.out.println("收到消息:" + message);
    22.             }
    23.         }, _TOPIC);
    24.     }
    25. }

    4.Netty 实现延迟任务

    Netty 是由 JBOSS 提供的一个 Java 开源框架,它是一个基于 NIO 的客户、服务器端的编程框架,使用 Netty 可以确保你快速和简单的开发出一个网络应用,例如实现了某种协议的客户、服务端应用。Netty 相当于简化和流线化了网络应用的编程开发过程,例如:基于 TCP 和 UDP 的 socket 服务开发。

    可以使用 Netty 提供的工具类 HashedWheelTimer 来实现延迟任务,实现代码如下。

    首先在项目中添加 Netty 引用,配置如下:

    1. <dependency>
    2.     <groupId>io.nettygroupId>
    3.     <artifactId>netty-commonartifactId>
    4.     <version>4.1.48.Finalversion>
    5. dependency>

    Netty 实现的完整代码如下:

    1. public class DelayTaskExample {
    2.     public static void main(String[] args) {
    3.         System.out.println("程序启动时间:" + LocalDateTime.now());
    4.         NettyTask();
    5.     }
    6.     /**
    7.      * 基于 Netty 的延迟任务
    8.      */
    9.     private static void NettyTask() {
    10.         // 创建延迟任务实例
    11.         HashedWheelTimer timer = new HashedWheelTimer(3// 时间间隔
    12.                 TimeUnit.SECONDS,
    13.                 100); // 时间轮中的槽数
    14.         // 创建一个任务
    15.         TimerTask task = new TimerTask() {
    16.             @Override
    17.             public void run(Timeout timeout) throws Exception {
    18.                 System.out.println("执行任务" +
    19.                         " ,执行时间:" + LocalDateTime.now());
    20.             }
    21.         };
    22.         // 将任务添加到延迟队列中
    23.         timer.newTimeout(task, 0, TimeUnit.SECONDS);
    24.     }
    25. }

    以上程序执行的结果为:

    程序启动时间:2020-04-13T10:16:23.033

    执行任务 ,执行时间:2020-04-13T10:16:26.118

    HashedWheelTimer 是使用定时轮实现的,定时轮其实就是一种环型的数据结构,可以把它想象成一个时钟,分成了许多格子,每个格子代表一定的时间,在这个格子上用一个链表来保存要执行的超时任务,同时有一个指针一格一格的走,走到那个格子时就执行格子对应的延迟任务,如下图所示:

    (图片来源于网络)

    以上的图片可以理解为,时间轮大小为 8,某个时间转一格(例如 1s),每格指向一个链表,保存着待执行的任务。

    5.MQ 实现延迟任务

    如果专门开启一个 MQ 中间件来执行延迟任务,就有点杀鸡用宰牛刀般的奢侈了,不过已经有了 MQ 环境的话,用它来实现延迟任务的话,还是可取的。

    几乎所有的 MQ 中间件都可以实现延迟任务,在这里更准确的叫法应该叫延队列。本文就使用 RabbitMQ 为例,来看它是如何实现延迟任务的。

    RabbitMQ 实现延迟队列的方式有两种:

    • 通过消息过期后进入死信交换器,再由交换器转发到延迟消费队列,实现延迟功能;

    • 使用 rabbitmq-delayed-message-exchange 插件实现延迟功能。

    注意:延迟插件 rabbitmq-delayed-message-exchange 是在 RabbitMQ 3.5.7 及以上的版本才支持的,依赖 Erlang/OPT 18.0 及以上运行环境。

    由于使用死信交换器比较麻烦,所以推荐使用第二种实现方式 rabbitmq-delayed-message-exchange 插件的方式实现延迟队列的功能。

    首先,我们需要下载并安装 rabbitmq-delayed-message-exchange 插件,下载地址:http://www.rabbitmq.com/community-plugins.html

    选择相应的对应的版本进行下载,然后拷贝到 RabbitMQ 服务器目录,使用命令 rabbitmq-plugins enable rabbitmq_delayed_message_exchange 开启插件,在使用命令 rabbitmq-plugins list 查询安装的所有插件,安装成功如下图所示:

    最后重启 RabbitMQ 服务,使插件生效。

    首先,我们先要配置消息队列,实现代码如下:

    1. import com.example.rabbitmq.mq.DirectConfig;
    2. import org.springframework.amqp.core.*;
    3. import org.springframework.context.annotation.Bean;
    4. import org.springframework.context.annotation.Configuration;
    5. import java.util.HashMap;
    6. import java.util.Map;
    7. @Configuration
    8. public class DelayedConfig {
    9.     final static String QUEUE_NAME = "delayed.goods.order";
    10.     final static String EXCHANGE_NAME = "delayedec";
    11.     @Bean
    12.     public Queue queue() {
    13.         return new Queue(DelayedConfig.QUEUE_NAME);
    14.     }
    15.     // 配置默认的交换机
    16.     @Bean
    17.     CustomExchange customExchange() {
    18.         Map<StringObject> args = new HashMap<>();
    19.         args.put("x-delayed-type""direct");
    20.         //参数二为类型:必须是x-delayed-message
    21.         return new CustomExchange(DelayedConfig.EXCHANGE_NAME"x-delayed-message"truefalse, args);
    22.     }
    23.     // 绑定队列到交换器
    24.     @Bean
    25.     Binding binding(Queue queue, CustomExchange exchange) {
    26.         return BindingBuilder.bind(queue).to(exchange).with(DelayedConfig.QUEUE_NAME).noargs();
    27.     }
    28. }

    然后添加增加消息的代码,具体实现如下:

    1. import org.springframework.amqp.AmqpException;
    2. import org.springframework.amqp.core.AmqpTemplate;
    3. import org.springframework.amqp.core.Message;
    4. import org.springframework.amqp.core.MessagePostProcessor;
    5. import org.springframework.beans.factory.annotation.Autowired;
    6. import org.springframework.stereotype.Component;
    7. import java.text.SimpleDateFormat;
    8. import java.util.Date;
    9. @Component
    10. public class DelayedSender {
    11.     @Autowired
    12.     private AmqpTemplate rabbitTemplate;
    13.     public void send(String msg) {
    14.         SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    15.         System.out.println("发送时间:" + sf.format(new Date()));
    16.         rabbitTemplate.convertAndSend(DelayedConfig.EXCHANGE_NAMEDelayedConfig.QUEUE_NAME, msg, new MessagePostProcessor() {
    17.             @Override
    18.             public Message postProcessMessage(Message message) throws AmqpException {
    19.                 message.getMessageProperties().setHeader("x-delay"3000);
    20.                 return message;
    21.             }
    22.         });
    23.     }
    24. }

    再添加消费消息的代码:

    1. import org.springframework.amqp.rabbit.annotation.RabbitHandler;
    2. import org.springframework.amqp.rabbit.annotation.RabbitListener;
    3. import org.springframework.stereotype.Component;
    4. import java.text.SimpleDateFormat;
    5. import java.util.Date;
    6. @Component
    7. @RabbitListener(queues = "delayed.goods.order")
    8. public class DelayedReceiver {
    9.     @RabbitHandler
    10.     public void process(String msg) {
    11.         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    12.         System.out.println("接收时间:" + sdf.format(new Date()));
    13.         System.out.println("消息内容:" + msg);
    14.     }
    15. }

    最后,我们使用代码测试一下:

    1. import com.example.rabbitmq.RabbitmqApplication;
    2. import com.example.rabbitmq.mq.delayed.DelayedSender;
    3. import org.junit.Test;
    4. import org.junit.runner.RunWith;
    5. import org.springframework.beans.factory.annotation.Autowired;
    6. import org.springframework.boot.test.context.SpringBootTest;
    7. import org.springframework.test.context.junit4.SpringRunner;
    8. import java.text.SimpleDateFormat;
    9. import java.util.Date;
    10. @RunWith(SpringRunner.class)
    11. @SpringBootTest
    12. public class DelayedTest {
    13.     @Autowired
    14.     private DelayedSender sender;
    15.     @Test
    16.     public void Test() throws InterruptedException {
    17.         SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
    18.         sender.send("Hi Admin.");
    19.         Thread.sleep(5 * 1000); //等待接收程序执行之后,再退出测试
    20.     }
    21. }

    以上程序的执行结果如下:

    发送时间:2020-04-13 20:47:51

    接收时间:2020-04-13 20:47:54 

    消息内容:Hi Admin.

    从结果可以看出,以上程序执行符合延迟任务的实现预期。

    6.使用 Spring 定时任务

    如果你使用的是 Spring 或 SpringBoot 的项目的话,可以使用借助 Scheduled 来实现,本文将使用 SpringBoot 项目来演示 Scheduled 的实现,实现我们需要声明开启 Scheduled,实现代码如下:

    1. @SpringBootApplication
    2. @EnableScheduling
    3. public class Application {
    4.     public static void main(String[] args) {
    5.         SpringApplication.run(Application.class, args);
    6.     }
    7. }

    然后添加延迟任务,实现代码如下:

    1. @Component
    2. public class ScheduleJobs {
    3.     @Scheduled(fixedDelay = 2 * 1000)
    4.     public void fixedDelayJob() throws InterruptedException {
    5.         System.out.println("任务执行,时间:" + LocalDateTime.now());
    6.     }
    7. }

    此时当我们启动项目之后就可以看到任务以延迟了 2s 的形式一直循环执行,结果如下:

    任务执行,时间:2020-04-13T14:07:53.349

    任务执行,时间:2020-04-13T14:07:55.350 

    任务执行,时间:2020-04-13T14:07:57.351

    ...

    我们也可以使用 Corn 表达式来定义任务执行的频率,例如使用 @Scheduled(cron = "0/4 * * * * ?") 。

    7.Quartz 实现延迟任务

    Quartz 是一款功能强大的任务调度器,可以实现较为复杂的调度功能,它还支持分布式的任务调度。

    我们使用 Quartz 来实现一个延迟任务,首先定义一个执行任务代码如下:

    1. import org.quartz.JobExecutionContext;
    2. import org.quartz.JobExecutionException;
    3. import org.springframework.scheduling.quartz.QuartzJobBean;
    4. import java.time.LocalDateTime;
    5. public class SampleJob extends QuartzJobBean {
    6.     @Override
    7.     protected void executeInternal(JobExecutionContext jobExecutionContext)
    8.             throws JobExecutionException {
    9.         System.out.println("任务执行,时间:" + LocalDateTime.now());
    10.     }
    11. }

    在定义一个 JobDetail 和 Trigger 实现代码如下:

    1. import org.quartz.*;
    2. import org.springframework.context.annotation.Bean;
    3. import org.springframework.context.annotation.Configuration;
    4. @Configuration
    5. public class SampleScheduler {
    6.     @Bean
    7.     public JobDetail sampleJobDetail() {
    8.         return JobBuilder.newJob(SampleJob.class).withIdentity("sampleJob")
    9.                 .storeDurably().build();
    10.     }
    11.     @Bean
    12.     public Trigger sampleJobTrigger() {
    13.         // 3s 后执行
    14.         SimpleScheduleBuilder scheduleBuilder =
    15.                 SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds(3).withRepeatCount(1);
    16.         return TriggerBuilder.newTrigger().forJob(sampleJobDetail()).withIdentity("sampleTrigger")
    17.                 .withSchedule(scheduleBuilder).build();
    18.     }
    19. }

    最后在 SpringBoot 项目启动之后开启延迟任务,实现代码如下:

    1. import org.springframework.beans.factory.annotation.Autowired;
    2. import org.springframework.boot.CommandLineRunner;
    3. import org.springframework.scheduling.quartz.SchedulerFactoryBean;
    4. /**
    5.  * SpringBoot 项目启动后执行
    6.  */
    7. public class MyStartupRunner implements CommandLineRunner {
    8.     @Autowired
    9.     private SchedulerFactoryBean schedulerFactoryBean;
    10.     @Autowired
    11.     private SampleScheduler sampleScheduler;
    12.     @Override
    13.     public void run(String... args) throws Exception {
    14.         // 启动定时任务
    15.         schedulerFactoryBean.getScheduler().scheduleJob(
    16.                 sampleScheduler.sampleJobTrigger());
    17.     }
    18. }

    以上程序的执行结果如下:

    2020-04-13 19:02:12.331  INFO 17768 --- [  restartedMain] com.example.demo.DemoApplication         : Started DemoApplication in 1.815 seconds (JVM running for 3.088) 

    任务执行,时间:2020-04-13T19:02:15.019

    从结果可以看出在项目启动 3s 之后执行了延迟任务。

    总结

    本文讲了延迟任务的使用场景,以及延迟任务的 10 种实现方式:

    1. 手动无线循环;

    2. ScheduledExecutorService;

    3. DelayQueue;

    4. Redis zset 数据判断的方式;

    5. Redis 键空间通知的方式;

    6. Netty 提供的 HashedWheelTimer 工具类;

    7. RabbitMQ 死信队列;

    8. RabbitMQ 延迟消息插件 rabbitmq-delayed-message-exchange;

    9. Spring Scheduled;

    10. Quartz。

    最后的话

    俗话说:台上一分钟,台下十年功。本文内容皆为作者多年工作积累的结晶,以及爆肝呕心沥血的整理,如果觉得本文有帮助到你,请帮我分享出去,让更多的人看到,谢谢你。

    敬请期待我的下一篇文章,谢谢。

    更多java进阶资料,面试资料,关注公众号

  • 相关阅读:
    地磁查询网站
    读书笔记:《北大管理课》
    STC 51单片机56——摇摇棒
    OpenShift 4 - 在 OpenShift Virtualization 上自动部署 OpenShift 托管集群(演示视频)
    Java 中 Volatile 关键字
    [附源码]Python计算机毕业设计Django蛋糕购物商城
    数据结构(栈和队列)
    JavaScript之正则表达式
    element表格分页+数据过滤筛选
    CloudCompare 二次开发(12)——点云投影到球面
  • 原文地址:https://blog.csdn.net/qq_19007169/article/details/126158815