Closed mcdonnelldean closed 8 years ago
Parralel
instance in the instance.next
and complete
, but rather instantiate an object as state, and stick everything in there. This is roughly 20-100% faster than allocating those function, see https://github.com/mcollina/aedes/blob/master/aedes.js#L201-L212 as an example.handler
first, store the result in the State
object, and then call the observe handlers.Basically you should never allocate a callback, if you want your code to be fast :).
@mcollina That's why you're my hero :D
@mcollina Removed a lot of this code in the end, split emit() and act() to simplify usage of each. Will move to steed over fastparallel. This should give me what I am looking for here. For now, this can be closed. Thanks for the input.
@mcollina Might need a look off you one this one. My observers get the pattern before the handler does. Logically in code, this makes sense, the handler is a callback. But I would like to handle observers after the fact as they are second in priority. Any ideas.
Logic is here: https://github.com/senecajs/varo/blob/master/lib/varo.js#L17-L41