Due to new requirements, the hard-coded config in the vanilla .php must instead be configurable through the Drupal UI. I have a working admin implementation, and have brought the socket-polling code inside the Drupal module. It's slow.
Is there a better way to approach this? Being able to set block caching independently of its parent page caching would be nice...
(Using local dev servers, a fully uncached page takes about 1000ms to render. The 'minimal print-don't-return' page takes about 400ms. The actual module code for getting the dynamic content takes 6ms of this. A fully cached page renders in 20ms.)