Explicitly use asyncio protocol for websockets

The new default for txaio (dependency of autobahn) requires that you
specify how you want websocket connections to be managed (asyncio or
twisted) and raises an exception if you don't make a choice.

Change-Id: I40695b17916cdd1795778be654a427210192ee2f
This commit is contained in:
Ryan S. Brown 2015-12-08 14:45:17 -05:00
parent 7ea62e4f2a
commit ae7c7ff5af
1 changed files with 2 additions and 0 deletions

View File

@ -21,6 +21,7 @@ from autobahn.asyncio import websocket
from oslo_log import log as logging
from oslo_utils import timeutils
import pytz
import txaio
try:
import asyncio
@ -51,6 +52,7 @@ class MessagingProtocol(websocket.WebSocketServerProtocol):
}
def __init__(self, handler, proto_id, auth_strategy, loop):
txaio.use_asyncio()
websocket.WebSocketServerProtocol.__init__(self)
self._handler = handler
self.proto_id = proto_id