##// END OF EJS Templates
add istype to canning...
add istype to canning allows strict type checking, but accept tuples to check like isinstance.

File last commit:

r8471:bd40426d
r9138:48e2fbe9
Show More
blockingkernelmanager.py
53 lines | 2.0 KiB | text/x-python | PythonLexer
/ IPython / zmq / blockingkernelmanager.py
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 """ Implements a fully blocking kernel manager.
Fernando Perez
Rework messaging to better conform to our spec....
r2926
Useful for test suites and blocking terminal interfaces.
"""
#-----------------------------------------------------------------------------
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 # Copyright (C) 2010-2012 The IPython Development Team
Fernando Perez
Rework messaging to better conform to our spec....
r2926 #
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 # Local imports.
epatters
REFACTOR: Terminology change: 'embedded' -> 'in-process'.
r8471 from IPython.inprocess.blockingkernelmanager import BlockingChannelMixin
Fernando Perez
Rework messaging to better conform to our spec....
r2926 from IPython.utils.traitlets import Type
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 from kernelmanager import KernelManager, SubSocketChannel, HBSocketChannel, \
ShellSocketChannel, StdInSocketChannel
Brian Granger
Added initial draft of blockingkernelmanager.py.
r2693
Fernando Perez
Rework messaging to better conform to our spec....
r2926 #-----------------------------------------------------------------------------
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 # Blocking kernel manager
Fernando Perez
Rework messaging to better conform to our spec....
r2926 #-----------------------------------------------------------------------------
Brian Granger
Added initial draft of blockingkernelmanager.py.
r2693
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 class BlockingSubSocketChannel(BlockingChannelMixin, SubSocketChannel):
pass
Fernando Perez
Rework messaging to better conform to our spec....
r2926
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 class BlockingShellSocketChannel(BlockingChannelMixin, ShellSocketChannel):
pass
Fernando Perez
Rework messaging to better conform to our spec....
r2926
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 class BlockingStdInSocketChannel(BlockingChannelMixin, StdInSocketChannel):
pass
Fernando Perez
Rework messaging to better conform to our spec....
r2926
class BlockingHBSocketChannel(HBSocketChannel):
epatters
Add missing msg queue + comment out debug printing in BlockingKernelManager.
r3825
MinRK
Fixes to the heartbeat channel...
r5614 # This kernel needs quicker monitoring, shorten to 1 sec.
# less than 0.5s is unreliable, and will get occasional
# false reports of missed beats.
time_to_dead = 1.
Fernando Perez
Rework messaging to better conform to our spec....
r2926
def call_handlers(self, since_last_heartbeat):
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 """ Pause beating on missed heartbeat. """
epatters
Add missing msg queue + comment out debug printing in BlockingKernelManager.
r3825 pass
Fernando Perez
Rework messaging to better conform to our spec....
r2926 class BlockingKernelManager(KernelManager):
# The classes to use for the various channels.
MinRK
cleanup channel names to match function not socket...
r3974 shell_channel_class = Type(BlockingShellSocketChannel)
Fernando Perez
Rework messaging to better conform to our spec....
r2926 sub_channel_class = Type(BlockingSubSocketChannel)
MinRK
cleanup channel names to match function not socket...
r3974 stdin_channel_class = Type(BlockingStdInSocketChannel)
Fernando Perez
Rework messaging to better conform to our spec....
r2926 hb_channel_class = Type(BlockingHBSocketChannel)