Warning

This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: kernel.channels

Base classes to manage a Client’s interaction with a running kernel

2 Classes

class IPython.kernel.channels.InvalidPortNumber

Bases: Exception

class IPython.kernel.channels.HBChannel(context=None, session=None, address=None)

Bases: threading.Thread

The heartbeat channel which monitors the kernel heartbeat.

Note that the heartbeat channel is paused by default. As long as you start this channel, the kernel manager will ensure that it is paused and un-paused as appropriate.

__init__(context=None, session=None, address=None)

Create the heartbeat monitor thread.

Parameters:

context : zmq.Context

The ZMQ context to use.

session : session.Session

The session to use.

address : zmq url

Standard (ip, port) tuple that the kernel is listening on.

call_handlers(since_last_heartbeat)

This method is called in the ioloop thread when a message arrives.

Subclasses should override this method to handle incoming messages. It is important to remember that this method is called in the thread so that some logic must be done to ensure that the application level handlers are called in the application thread.

is_beating()

Is the heartbeat running and responsive (and not paused).

pause()

Pause the heartbeat.

run()

The thread’s main activity. Call start() instead.

stop()

Stop the channel’s event loop and join its thread.

unpause()

Unpause the heartbeat.