Closed Horki closed 4 years ago
Thanks, I'll take a look at it in a bit. I've been meaning to touch up the examples and add more -- then realized they were mostly the same and never got around to de-duplicating it.
Thinking about it, I do sort of like the idea that you can just copy/paste an example and it just works.
But, these helper functions do make it easier to read the code. I would rather have handle_message()
in each example, though, because its a very core idea. This function is 'verbose' intentionally so you can see all of the enum variants for the message types.
If we do move it 'include' then the main_loop()
could also be moved into it with that function inlined into the body.
@museun they are still visible, even when pasted into include/mod
;
IMHO main_loop is core
of example, rest isn't
@museun please test #202