@@ -177,7 +177,7 @@ async def send(self, channel: str, message: typing.Any) -> None:
177
177
"""
178
178
# Typecheck
179
179
assert isinstance (message , dict ), "message is not a dict"
180
- assert self .valid_channel_name (channel ), "Channel name not valid"
180
+ assert self .require_valid_channel_name (channel ), "Channel name not valid"
181
181
# Make sure the message does not contain reserved keys
182
182
assert "__asgi_channel__" not in message
183
183
# If it's a process-local channel, strip off local part and stick full name in message
@@ -266,7 +266,7 @@ async def receive(self, channel: str) -> typing.Any:
266
266
"""
267
267
# Make sure the channel name is valid then get the non-local part
268
268
# and thus its index
269
- assert self .valid_channel_name (channel )
269
+ assert self .require_valid_channel_name (channel )
270
270
if "!" in channel :
271
271
real_channel = self .non_local_name (channel )
272
272
assert real_channel .endswith (
@@ -389,7 +389,9 @@ async def receive_single(
389
389
Receives a single message off of the channel and returns it.
390
390
"""
391
391
# Check channel name
392
- assert self .valid_channel_name (channel , receive = True ), "Channel name invalid"
392
+ assert self .require_valid_channel_name (
393
+ channel , receive = True
394
+ ), "Channel name invalid"
393
395
# Work out the connection to use
394
396
if "!" in channel :
395
397
assert channel .endswith ("!" )
@@ -494,8 +496,8 @@ async def group_add(self, group: str, channel: str) -> None:
494
496
Adds the channel name to a group.
495
497
"""
496
498
# Check the inputs
497
- assert self .valid_group_name (group ), "Group name not valid"
498
- assert self .valid_channel_name (channel ), "Channel name not valid"
499
+ assert self .require_valid_group_name (group ), "Group name not valid"
500
+ assert self .require_valid_channel_name (channel ), "Channel name not valid"
499
501
# Get a connection to the right shard
500
502
group_key = self ._group_key (group )
501
503
connection = self .connection (self .consistent_hash (group ))
@@ -510,8 +512,8 @@ async def group_discard(self, group: str, channel: str) -> None:
510
512
Removes the channel from the named group if it is in the group;
511
513
does nothing otherwise (does not error)
512
514
"""
513
- assert self .valid_group_name (group ), "Group name not valid"
514
- assert self .valid_channel_name (channel ), "Channel name not valid"
515
+ assert self .require_valid_group_name (group ), "Group name not valid"
516
+ assert self .require_valid_channel_name (channel ), "Channel name not valid"
515
517
key = self ._group_key (group )
516
518
connection = self .connection (self .consistent_hash (group ))
517
519
await connection .zrem (key , channel )
@@ -520,7 +522,7 @@ async def group_send(self, group: str, message: typing.Any) -> None:
520
522
"""
521
523
Sends a message to the entire group.
522
524
"""
523
- assert self .valid_group_name (group ), "Group name not valid"
525
+ assert self .require_valid_group_name (group ), "Group name not valid"
524
526
# Retrieve list of all channel names
525
527
key = self ._group_key (group )
526
528
connection = self .connection (self .consistent_hash (group ))
0 commit comments