Add stream name in handler context - #219
Conversation
| } | ||
|
|
||
| $handler = $this->handlers[$event->messageName()]; | ||
| $handler = Closure::bind($handler, $this->createHandlerContext($streamName)); |
There was a problem hiding this comment.
Any ideas an how to bind earlier, so no new context is created for every event?
There was a problem hiding this comment.
Or is this no performance problem at all?
There was a problem hiding this comment.
Perhaps we add stream name as third argument to the handler, but this is something I like to avoid.
There was a problem hiding this comment.
handler context could be created outside of the foreach and with a setStreamName method but I would only do this if it has really positive influence on the performance.
There was a problem hiding this comment.
ah forget my idea. Immutability is king.
| } | ||
|
|
||
| $handler = $this->handlers[$event->messageName()]; | ||
| $handler = Closure::bind($handler, $this->createHandlerContext($streamName)); |
There was a problem hiding this comment.
handler context could be created outside of the foreach and with a setStreamName method but I would only do this if it has really positive influence on the performance.
No description provided.