Break up websocket 2 (#17028)

* Break up websocket 2

* Lint+Test

* Lintttt

* Rename
This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2018-10-01 16:09:31 +02:00
1 parent b5e3d8c337
commit 2e6346ca43
27 files changed
+641 -568

No files matched your search

@@ -1,4 +1,11 @@
"""Websocket constants."""
import asyncio
from concurrent import futures
DOMAIN = 'websocket_api'
URL = '/api/websocket'
MAX_PENDING_MSG = 512
ERR_ID_REUSE = 1
ERR_INVALID_FORMAT = 2
ERR_NOT_FOUND = 3
@@ -6,3 +13,8 @@ ERR_UNKNOWN_COMMAND = 4
ERR_UNKNOWN_ERROR = 5
TYPE_RESULT = 'result'
# Define the possible errors that occur when connections are cancelled.
# Originally, this was just asyncio.CancelledError, but issue #9546 showed
# that futures.CancelledErrors can also occur in some situations.
CANCELLATION_ERRORS = (asyncio.CancelledError, futures.CancelledError)