kernel.controllerservice

Module: kernel.controllerservice

Inheritance diagram for IPython.kernel.controllerservice:

A Twisted Service for the IPython Controller.

The IPython Controller:

  • Listens for Engines to connect and then manages access to those engines.
  • Listens for clients and passes commands from client to the Engines.
  • Exposes an asynchronous interfaces to the Engines which themselves can block.
  • Acts as a gateway to the Engines.

The design of the controller is somewhat abstract to allow flexibility in how the controller is presented to clients. This idea is that there is a basic ControllerService class that allows engines to connect to it. But, this basic class has no client interfaces. To expose client interfaces developers provide an adapter that makes the ControllerService look like something. For example, one client interface might support task farming and another might support interactive usage. The important thing is that by using interfaces and adapters, a single controller can be accessed from multiple interfaces. Furthermore, by adapting various client interfaces to various network protocols, each client interface can be exposed to multiple network protocols. See multiengine.py for an example of how to adapt the ControllerService to a client interface.

Classes

ControllerAdapterBase

class IPython.kernel.controllerservice.ControllerAdapterBase(controller)

Bases: object

All Controller adapters should inherit from this class.

This class provides a wrapped version of the IControllerBase interface that can be used to easily create new custom controllers. Subclasses of this will provide a full implementation of IControllerBase.

This class doesn’t implement any client notification mechanism. That is up to subclasses.

__init__()
on_n_engines_registered_do()
on_register_engine_do()
on_register_engine_do_not()
on_unregister_engine_do()
on_unregister_engine_do_not()
register_engine()
unregister_engine()

ControllerService

class IPython.kernel.controllerservice.ControllerService(maxEngines=511, saveIDs=False)

Bases: object, twisted.application.service.Service

A basic Controller represented as a Twisted Service.

This class doesn’t implement any client notification mechanism. That is up to adapted subclasses.

__init__()
name = 'ControllerService'
on_n_engines_registered_do()
on_register_engine_do()
on_register_engine_do_not()
on_unregister_engine_do()
on_unregister_engine_do_not()
register_engine()

Register new engine connection

unregister_engine()

Unregister engine by id.

IControllerBase

class IPython.kernel.controllerservice.IControllerBase(name, bases=(), attrs=None, __doc__=None, __module__=None)

Bases: IPython.kernel.controllerservice.IControllerCore

The basic controller interface.

classmethod __init__()
dependents = <WeakKeyDictionary at 151413896>

IControllerCore

class IPython.kernel.controllerservice.IControllerCore(name, bases=(), attrs=None, __doc__=None, __module__=None)

Bases: zope.interface.Interface

Basic methods any controller must have.

This is basically the aspect of the controller relevant to the engines and does not assume anything about how the engines will be presented to a client.

classmethod __init__()
dependents = <WeakKeyDictionary at 151414976>

Table Of Contents

Previous topic

kernel.contexts

Next topic

kernel.core.display_formatter

This Page