mojo: Reorganize event notification code for new clients.

Authored by mpyne on Jul 8 2018, 9:37 PM.

Description

mojo: Reorganize event notification code for new clients.

I think this fixes some issues I was seeing with using the same
kdesrc-build process to add as a status server and also as a client of
that server. In particular the "build_plan" event seemed to get missed
by the in-process client, even though it is generated even before any of
the major Mojolicious-using code is initialized.

New clients are sent the current list of all previously-handled events
when they register a new WebSocket connection, which should include the
"build_plan" event. The idea is that all subsequent events are then
automatically sent to the client to ensure sync is maintained.

However this means there were two separate callbacks for sending events
to clients, and these 2 handlers could be split up across different
parts of the event loop. I can't think of a specific use case where this
could fail, but nonetheless moving these two into a single callback
seems to fix the missing build_plan issue.

Details

Committed
mpyneJul 8 2018, 9:37 PM
Parents
R365:cfd2d8c128e9: mojo: Complete porting build-status.pl into kdesrc-build.
Branches
Unknown
Tags
Unknown