papaer
V2EX  ›  问与答

一个方法里的并行多个 rpc 调用 怎么做隔离?

  •  
  •   papaer · Apr 25, 2022 · 2270 views
    This topic created in 1663 days ago, the information mentioned may be changed or developed.

    void f(){ restTemplate.getForObject("/f1"+id, ResultInfo.class); restTemplate.getForObject("/f2"+id, ResultInfo.class); restTemplate.getForObject("/f3/"+id, ResultInfo.class); restTemplate.getForObject("/f4/"+id, ResultInfo.class); } 想要隔离 这四个调用

    3 replies  •  2022-04-26 06:37:14 +08:00
    papaer
    papaer
    OP
    Apr 25, 2022
    1
    格式优点乱,就是四个互不影响的
    远程调用
    golangLover
    golangLover
    Apr 25, 2022 via Android
    2
    隔离是什么意思
    micean
    micean
    Apr 26, 2022 via Android
    3
    放线程池里,走 future
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2191 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 11:07 · PVG 19:07 · LAX 03:07 · JFK 06:07
    ♥ Do have faith in what you're doing.