• 请不要在回答技术问题时复制粘贴 AI 生成的内容
winRain
V2EX  ›  程序员

doOnNext 中使用 subscribe() 难道不会阻塞吗?

  •  
  •   winRain · Jun 23, 2021 · 1079 views
    This topic created in 1784 days ago, the information mentioned may be changed or developed.

    代码如下:

    public Flux<Student> doSomething() {
        return this.rtpl.findAll(Student.class).doOnNext(student -> {
            Record rec = new Record();
            rec.setRecord(String.format("学生第 %s 次查成绩", count.addAndGet(1)));
            this.rtpl.insert(rec).subscribe();
        });
    }
    

    在使用 subscribe 的地方,idea 并没有阻塞的警告,是真的不会阻塞吗?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5651 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 07:31 · PVG 15:31 · LAX 00:31 · JFK 03:31
    ♥ Do have faith in what you're doing.