I removed the LSL outlet dependency by injecting a "messenger" object. To keep things simple, the messenger is just a delegate, taking over responsibility for sending an event message, ex: "marker received". If we want to implement a true observer pattern (ex: publish / subscribe), we can make a messenger object that does that. Either way, EEG_data shouldn't have to care. At this point, I don't think pub/sub is needed.
All the "offline test" examples and existing unit tests don't need a messenger, so I made the default "None". If there isn't a messenger available, EEG_data won't try sending messages.
I added an LslMessenger for all the "unity backend" examples. They create it and pass to EEG_data.
I added another test for the "ping" message in test_eeg_data.py. This demonstrates using a mock Messenger object for testing, in this case, counting pings after running a few loops.
B4K-227
I removed the LSL outlet dependency by injecting a "messenger" object. To keep things simple, the messenger is just a delegate, taking over responsibility for sending an event message, ex: "marker received". If we want to implement a true observer pattern (ex: publish / subscribe), we can make a messenger object that does that. Either way, EEG_data shouldn't have to care. At this point, I don't think pub/sub is needed.
All the "offline test" examples and existing unit tests don't need a messenger, so I made the default "None". If there isn't a messenger available, EEG_data won't try sending messages.
I added an LslMessenger for all the "unity backend" examples. They create it and pass to EEG_data.
I added another test for the "ping" message in test_eeg_data.py. This demonstrates using a mock Messenger object for testing, in this case, counting pings after running a few loops.