@@ -169,7 +169,7 @@ async def send(self, channel, message):
169
169
"""
170
170
# Typecheck
171
171
assert isinstance (message , dict ), "message is not a dict"
172
- assert self .valid_channel_name (channel ), "Channel name not valid"
172
+ assert self .require_valid_channel_name (channel ), "Channel name not valid"
173
173
# Make sure the message does not contain reserved keys
174
174
assert "__asgi_channel__" not in message
175
175
# If it's a process-local channel, strip off local part and stick full name in message
@@ -256,7 +256,7 @@ async def receive(self, channel):
256
256
"""
257
257
# Make sure the channel name is valid then get the non-local part
258
258
# and thus its index
259
- assert self .valid_channel_name (channel )
259
+ assert self .require_valid_channel_name (channel )
260
260
if "!" in channel :
261
261
real_channel = self .non_local_name (channel )
262
262
assert real_channel .endswith (
@@ -377,7 +377,7 @@ async def receive_single(self, channel):
377
377
Receives a single message off of the channel and returns it.
378
378
"""
379
379
# Check channel name
380
- assert self .valid_channel_name (channel , receive = True ), "Channel name invalid"
380
+ assert self .require_valid_channel_name (channel , receive = True ), "Channel name invalid"
381
381
# Work out the connection to use
382
382
if "!" in channel :
383
383
assert channel .endswith ("!" )
@@ -482,8 +482,8 @@ async def group_add(self, group, channel):
482
482
Adds the channel name to a group.
483
483
"""
484
484
# Check the inputs
485
- assert self .valid_group_name (group ), "Group name not valid"
486
- assert self .valid_channel_name (channel ), "Channel name not valid"
485
+ assert self .require_valid_group_name (group ), "Group name not valid"
486
+ assert self .require_valid_channel_name (channel ), "Channel name not valid"
487
487
# Get a connection to the right shard
488
488
group_key = self ._group_key (group )
489
489
connection = self .connection (self .consistent_hash (group ))
@@ -498,8 +498,8 @@ async def group_discard(self, group, channel):
498
498
Removes the channel from the named group if it is in the group;
499
499
does nothing otherwise (does not error)
500
500
"""
501
- assert self .valid_group_name (group ), "Group name not valid"
502
- assert self .valid_channel_name (channel ), "Channel name not valid"
501
+ assert self .require_valid_group_name (group ), "Group name not valid"
502
+ assert self .require_valid_channel_name (channel ), "Channel name not valid"
503
503
key = self ._group_key (group )
504
504
connection = self .connection (self .consistent_hash (group ))
505
505
await connection .zrem (key , channel )
@@ -508,7 +508,7 @@ async def group_send(self, group, message):
508
508
"""
509
509
Sends a message to the entire group.
510
510
"""
511
- assert self .valid_group_name (group ), "Group name not valid"
511
+ assert self .require_valid_group_name (group ), "Group name not valid"
512
512
# Retrieve list of all channel names
513
513
key = self ._group_key (group )
514
514
connection = self .connection (self .consistent_hash (group ))
0 commit comments