Break up websocket 2 (#17028)
* Break up websocket 2 * Lint+Test * Lintttt * Rename
This commit is contained in:
parent
b5e3d8c337
commit
2e6346ca43
27 changed files with 641 additions and 568 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue