merged branch igorw/lazy-dispatcher (PR #705)
This PR was submitted for the 1.0 branch but it was merged into the master branch instead (closes #705). Discussion ---------- Make dispatcher lazy, do not trigger its creation on middleware definition The dispatcher has quite a few dependencies due to all of the subscribers that are added to it. One of these is the logger, several other services are affected as well though. The listener shortcut methods like on(), before(), after(), error() all force creation of the dispatcher and thus all of its dependencies. This makes it impossible to have lazy configuration of those services. The specific issue that triggered this was lazy configuration of the logger, which simply does not work once you have before() or after(). By using extend(), all of those shortcut calls can delay the creation of the dispatcher and thus solve the issue. It will add a slight overhead, but it should be relatively small, since the results of creating a service are memoized through share(). Commits ------- efa0383 Add changelog entry for lazy dispatcher proxies 59b56b0 Make dispatcher lazy, do not trigger its creation on middleware definition
Showing
Please register or sign in to comment