I want to be able to detect from outside a notebook server if the kernel is busy or actively running some cell.
Is there some way for me to print this state as a command line call or have it returned as the response to a http request.
There is not, this state is not stored anywhere, in part because it changes rapidly, and in part because there shouldn't be many, if any, actions that should be taken differently based on its value. It is only published via messages on the IOPub channel, which you can connect to via zeromq or websocket. If you want to know the busy/idle state of a kernel:
kernel_info
requeststatus
IOPub messages for busy/idle changesIf the kernel is idle, it will handle the kernel_info request promptly and you will get a status:idle message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With