You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to define a catch-all event handler like '*' etc on client and server? This might be needed to send a response in case of missing event handlers.
Also, what happens if event handler does not exist? In my tests, nothing happens (no event handlers get called). Does it mean no memory is allocated/wasted etc in case of a huge number of such events?
On a slightly different topic, I am thinking of emitting events such that their response handlers could also be defined at the time of event emittance. For example,
The .send method will do the heavy lifting of calling .write() and making sure timeout is not hit (error_cb will be called in that case). We need to make sure server side also deals with events appropriately and responds.
Has it been implemented already? Any tips on the most efficient way this could be achieved?
The text was updated successfully, but these errors were encountered:
No, our event emitter is an instance of eventemitter3 or Stream and wildcards are not supported there.
Not much, a packet is sent from server to client or vice versa but if there isn't a listener on the receiving end, the emit method on that end returns false and nothing happens. You can't know if the other end has a registered listener for the event you are sending so the packet is sent in all cases.
I'm not sure what you want to do, the feature seems similar to an "ack", primus-emitter supports "acks" but it doesn't take the timeout into account.
For 3: I am trying to use request-response pattern. And, in fact trying to somehow convert event-driven features to request-response pattern taking timeouts/disconnects etc into account.
I will look at primus-emitter and I hope primus-emitter is compatible with omega-supreme, primus-emit, substream, mirage, metroplex etc.
The .send method will do the heavy lifting of calling .write() and making sure timeout is not hit (error_cb will be called in that case). We need to make sure server side also deals with events appropriately and responds.
Has it been implemented already? Any tips on the most efficient way this could be achieved?
The text was updated successfully, but these errors were encountered: