Closed michielbdejong closed 2 months ago
The refactor is going quite well so far, with Giraffe as a base class. One main thing to work out is how to update the message forwarder. I think it makes sense if the tests instantiate a NetworkSimulator, and adds NetworkNodes with names to it.
A NetworkNode has a process
method, and it emits message(to, msgStr)
events
The TraceManager needs to read Probe info when a Trace comes in. I vaguely remember you can do this with events, but in https://nodejs.org/api/events.html I only see reference to catching an error from a listener, not to getting a return value.
I'll pass an anonymous function to the event handler. Might refactor this later if I have a better idea.
There are many things going on in the Node and Giraffe code:
Maybe I can make it nicer if I use some sub objects: