##// END OF EJS Templates
Fix race condition in javascript kernel message processing...
Fix race condition in javascript kernel message processing Because the binary messages are now deserialized using the asynchronous FileReader API, we need to have some way to force the messages to still be processed in the order they are received. This patch implements a simple processing queue using promises.

File last commit:

r19980:515b791b
r20441:834cd9c4
Show More
__init__.py
26 lines | 1.1 KiB | text/x-python | PythonLexer
import os
import terminado
from IPython.utils.version import check_version
if not check_version(terminado.__version__, '0.3.3'):
raise ImportError("terminado >= 0.3.3 required, found %s" % terminado.__version__)
from terminado import NamedTermManager
from tornado.log import app_log
from IPython.html.utils import url_path_join as ujoin
from .handlers import TerminalHandler, TermSocket
from . import api_handlers
def initialize(webapp):
shell = os.environ.get('SHELL', 'sh')
terminal_manager = webapp.settings['terminal_manager'] = NamedTermManager(shell_command=[shell])
terminal_manager.log = app_log
base_url = webapp.settings['base_url']
handlers = [
(ujoin(base_url, r"/terminals/(\w+)"), TerminalHandler),
(ujoin(base_url, r"/terminals/websocket/(\w+)"), TermSocket,
{'term_manager': terminal_manager}),
(ujoin(base_url, r"/api/terminals"), api_handlers.TerminalRootHandler),
(ujoin(base_url, r"/api/terminals/(\w+)"), api_handlers.TerminalHandler),
]
webapp.add_handlers(".*$", handlers)