Closed mcdonnelldean closed 9 years ago
How about a defineMessage(name, encoderObj)
or defineEvent(name, encoderObj)
thing? So we can get rid of the whole schema
in new HyperEmitter()
.
My idea is that, if a message is not known, we should emit an event in hyper.status
, which is a stock EventEmitter
.
Ok so there are a couple of parts to your answer, let me see if I have them right:
.status
emitter (we need to document this too)Are these right?
No, I think we should everything we don't understand on the main HyperEmitter, as buffers
, which is exactly what this thing is about: moving buffers.
Than encodings will do automatic transforms from/to Buffers, for the specified messages.
Yes, let's add a addEncoding()
method that takes care of adding that thing.
Is this all you need?
Support added in #15
Given the following code:
What do we think should happen? We also need to consider that some encoders may not need or use a schema and would send the messages anyway.