@@ -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,9 @@ 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 (
381
+ channel , receive = True
382
+ ), "Channel name invalid"
381
383
# Work out the connection to use
382
384
if "!" in channel :
383
385
assert channel .endswith ("!" )
@@ -482,8 +484,8 @@ async def group_add(self, group, channel):
482
484
Adds the channel name to a group.
483
485
"""
484
486
# 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"
487
+ assert self .require_valid_group_name (group ), "Group name not valid"
488
+ assert self .require_valid_channel_name (channel ), "Channel name not valid"
487
489
# Get a connection to the right shard
488
490
group_key = self ._group_key (group )
489
491
connection = self .connection (self .consistent_hash (group ))
@@ -498,8 +500,8 @@ async def group_discard(self, group, channel):
498
500
Removes the channel from the named group if it is in the group;
499
501
does nothing otherwise (does not error)
500
502
"""
501
- assert self .valid_group_name (group ), "Group name not valid"
502
- assert self .valid_channel_name (channel ), "Channel name not valid"
503
+ assert self .require_valid_group_name (group ), "Group name not valid"
504
+ assert self .require_valid_channel_name (channel ), "Channel name not valid"
503
505
key = self ._group_key (group )
504
506
connection = self .connection (self .consistent_hash (group ))
505
507
await connection .zrem (key , channel )
@@ -508,7 +510,7 @@ async def group_send(self, group, message):
508
510
"""
509
511
Sends a message to the entire group.
510
512
"""
511
- assert self .valid_group_name (group ), "Group name not valid"
513
+ assert self .require_valid_group_name (group ), "Group name not valid"
512
514
# Retrieve list of all channel names
513
515
key = self ._group_key (group )
514
516
connection = self .connection (self .consistent_hash (group ))
0 commit comments