holoviz / pyviz_comms

Bidirectional communication for the HoloViz ecosystem
BSD 3-Clause "New" or "Revised" License
32 stars 15 forks source link

Added on_error and on_stdout handlers to Comm #46

Closed philippjfr closed 4 years ago

philippjfr commented 4 years ago

For a very long time our Comms have routed errors and stdout output back to the JS side since we didn't see a clear way for them to route their output to the cell the output is displayed in. This PR adds on_error and on_stdout handlers which can process the output as required by the library using them, e.g. Panel will create a display handle for each output which it will route any error messages and stdout output to but other libraries can register a handler to log the output or do whatever else they want to do with it.