File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ async def connect(self):
34
34
35
35
async def disconnect (self , code ):
36
36
if self .connection_context :
37
+ self .connection_context .closed = True
37
38
await subscription_server .on_close (self .connection_context )
38
39
39
40
async def receive_json (self , content ):
Original file line number Diff line number Diff line change 10
10
11
11
12
12
class ChannelsConnectionContext (BaseConnectionContext ):
13
+ def __init__ (self , * args , ** kwargs ):
14
+ super (ChannelsConnectionContext , self ).__init__ (* args , ** kwargs )
15
+ self .closed = False
16
+
13
17
async def send (self , data ):
14
18
if self .closed :
15
19
return
16
20
await self .ws .send_json (data )
17
21
18
- @property
19
- def closed (self ):
20
- return self .ws .closed
21
-
22
22
async def close (self , code ):
23
23
await self .ws .close (code = code )
24
24
You can’t perform that action at this time.
0 commit comments