V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
lml12377
V2EX  ›  程序员

Symfony 中的子请求有什么用途?

  •  
  •   lml12377 · Aug 24, 2016 · 2832 views
    This topic created in 3534 days ago, the information mentioned may be changed or developed.

    看 Symfony 框架,发现 HttpKernel 分了 MASTER_REQUEST 和 SUB_REQUEST ,而且 kernel 做 handle() 时还有个请求栈 requestStack ,一个 url 不是对应一个 Request 请求嘛,为什么还有子请求这个概念?是程序内发出的请求?这个子请求的应用场景是怎样的?主要是为了解决什么问题啊?

    求解!

    2 replies    2016-08-25 10:06:17 +08:00
    ZYWJ
        1
    ZYWJ  
       Aug 24, 2016   ❤️ 1
    likezun
        2
    likezun  
       Aug 25, 2016   ❤️ 1
    我觉得核心就是:
    The only difference internally is that some listeners (e.g. security) may only act upon the master request. Each listener is passed some sub-class of KernelEvent, whose isMasterRequest() can be used to check if the current request is a "master" or "sub" request.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1101 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:21 · PVG 02:21 · LAX 11:21 · JFK 14:21
    ♥ Do have faith in what you're doing.