Note
This documentation is for a development version of IPython. There may be significant differences from the latest stable release (1.2.1).
Base classes to manage a Client’s interaction with a running kernel
Bases: exceptions.Exception
Bases: threading.Thread
The base class for the channels that use ZMQ sockets.
Create a channel.
Parameters: | context : zmq.Context
session : session.Session
address : zmq url
|
---|
Get the channel’s address as a zmq url string.
These URLS have the form: ‘tcp://127.0.0.1:5555‘.
Bases: IPython.kernel.channels.ZMQSocketChannel
The shell channel for issuing request/replies to the kernel.
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.
Tab complete text in the kernel’s namespace.
Parameters: | text : str
line : str
cursor_pos : int
block : str, optional
|
---|---|
Returns: | The msg_id of the message sent. |
Execute code in the kernel.
Parameters: | code : str
silent : bool, optional (default False)
store_history : bool, optional (default True)
user_variables : list, optional
user_expressions : dict, optional
allow_stdin : bool, optional (default self.allow_stdin)
|
---|---|
Returns: | The msg_id of the message sent. |
Get entries from the kernel’s history list.
Parameters: | raw : bool
output : bool
hist_access_type : str
session : int
start : int
stop : int
n : int
pattern : str
|
---|---|
Returns: | The msg_id of the message sent. |
Request kernel info.
Get metadata information about an object in the kernel’s namespace.
Parameters: | oname : str
detail_level : int, optional
|
---|---|
Returns: | The msg_id of the message sent. |
The thread’s main activity. Call start() instead.
Request an immediate kernel shutdown.
Upon receipt of the (empty) reply, client code can safely assume that the kernel has shut down and it’s safe to forcefully terminate it if it’s still alive.
The kernel will send the reply via a function registered with Python’s atexit module, ensuring it’s truly done as the kernel is done with all normal operation.
Bases: IPython.kernel.channels.ZMQSocketChannel
The iopub channel which listens for messages that the kernel publishes.
This channel is where all output is published to frontends.
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 leve handlers are called in the application thread.
Immediately processes all pending messages on the iopub channel.
Callers should use this method to ensure that call_handlers() has been called for all messages that have been received on the 0MQ SUB socket of this channel.
This method is thread safe.
Parameters: | timeout : float, optional
|
---|
The thread’s main activity. Call start() instead.
Bases: IPython.kernel.channels.ZMQSocketChannel
The stdin channel to handle raw_input requests that the kernel makes.
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 leve handlers are called in the application thread.
Send a string of raw input to the kernel.
The thread’s main activity. Call start() instead.
Bases: IPython.kernel.channels.ZMQSocketChannel
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.
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 the heartbeat running and responsive (and not paused).
Pause the heartbeat.
The thread’s main activity. Call start() instead.
Stop the channel’s event loop and join its thread.
Unpause the heartbeat.