wk1563396689
V2EX  ›  问与答

如何判断写入数据库的 log 已经写入完毕,然后我输出个结束语句?

  •  
  •   wk1563396689 · Jun 16, 2020 · 1253 views
    This topic created in 2166 days ago, the information mentioned may be changed or developed.

    两者是异步进行的,log 是从另外一台机器发 request 回传回来的,回传回来之后会更新下状态,但是我根据状态判断发现我输出的 log 会插到回传回来的 log 中间

    3 replies    2020-06-16 09:53:33 +08:00
    securityCoding
        1
    securityCoding  
       Jun 16, 2020
    搞个队列(内存或者中间件)消息有序的处理?
    gotonull
        2
    gotonull  
       Jun 16, 2020
    异步不是有回调吗
    rockyou12
        3
    rockyou12  
       Jun 16, 2020
    你不等人家,当然就会乱啊,异步看你用的什么 api,一般要不有回调,要不可以 await
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3965 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 05:12 · PVG 13:12 · LAX 22:12 · JFK 01:12
    ♥ Do have faith in what you're doing.