GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — KernelEvents::TERMINATE will dispatch twice after push HttpCache to stack · Issue #10 · stackphp/builder

This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

KernelEvents::TERMINATE will dispatch twice after push HttpCache to stack #10

Copy link
Copy link
Closed
Closed
KernelEvents::TERMINATE will dispatch twice after push HttpCache to stack#10
Copy link

Description

@thbourlove
thbourlove
opened on Nov 19, 2014
Issue body actions
No description provided.

Activity

  1. igorw commented on Nov 19, 2014

    @igorw
    igorw
    on Nov 19, 2014
    Contributor
    More actions

    First of all, thanks so much for reporting this!

    This highlights a pretty interesting flaw in the current design of the stack. The stack assumes that every middleware will handle its own layer of termination. The stack just triggers every terminate() individually. However, this is not the case. Since a middleware is a decorator, if it implements terminate(), it will of course also call terminate() on the next layer!

    As a result, it will be called once by stack, and once by the cache middleware itself.

    The reason for doing this in the first place, is that terminable is optional. So because not every middleware of the chain has to implement it, the chain can be broken. The point of the stack is to never break this chain, and call all of the terminable middlewares.

    I have some ideas for fixing the problem, but it is going to get a bit complicated.

  2. igorw commented on Nov 19, 2014

    @igorw
    igorw
    on Nov 19, 2014
    Contributor
    More actions

    It's... complicated.

  3. igorw
    added 2 commits that reference this issue on Nov 19, 2014

    Build safe chain of terminable kernels (fixes #10)

    This issue will close once commit acea575 is merged into the 'master' branch.
    acea575

    Assume Terminable middlewares will delegate (fixes #10)

    This issue will close once commit 17887ec is merged into the 'master' branch.
    17887ec
  4. igorw
    closed this as completedin 17887econ Nov 23, 2014
  5. igorw
    added a commit that references this issue on Nov 23, 2014

    Update CHANGELOG for v1.0.3, refs #10

    c1f8a46
  6. igorw commented on Nov 23, 2014

    @igorw
    igorw
    on Nov 23, 2014
    Contributor
    More actions

    This issue has been fixed in v1.0.3, thanks so much for reporting it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.