That's very interesting work. I did a similar thing for Kore for its background task implementation so that page handlers could talk to its tasks it fired off and read its responses accordingly.
See example on https://github.com/jorisvink/kore/tree/master/examples/tasks