ソースを参照

auto commit

master
jfinn 2年前
コミット
968dd14331
1個のファイルの変更45行の追加6行の削除
  1. 45
    6
      wsps/consumers.py

+ 45
- 6
wsps/consumers.py ファイルの表示

@@ -10,11 +10,8 @@ Mixins = wsps.tasks_loop.Mixins
10 10
 
11 11
 # class ChatConsumer(WebsocketConsumer,wsps.tasks_loop.AclTaskMixin,wsps.tasks_loop.AconMixin):
12 12
 class DispConsumer():
13
-	async def ws_conn0(self):
14
-		print("WS~~ DispConsumer")
15 13
 	async def ws_rec_once(self, text_data):
16 14
 		# print("WS~~ 12")
17
-		# print("WS~~ DispConsumer")
18 15
 		msg_data = json.loads(text_data) 
19 16
 		# if 'message' in text_data_json:
20 17
 
@@ -32,13 +29,47 @@ class DispConsumer():
32 29
 
33 30
 
34 31
 
35
-class ChatConsumer():
32
+class ChatConsumer(
33
+	DispConsumer,
34
+	Mixins.DevMixin,
35
+	Mixins.LoneMixinA,
36
+	Mixins.AclTaskMixin,
37
+	Mixins.AconMixin,
38
+	Mixins.LoneMixinB,
39
+	Mixins.DevMroMixin,
40
+	AsyncWebsocketConsumer,
41
+	):
42
+	# def connect(self):
36 43
 	async def ws_conn0(self):
37
-		print("WS~~ ChatConsumer")
44
+
45
+		# print("ChatConsumer:ws_conn0")
46
+		# p("!!!!!!!!!!!!!!!!!!!!?")
38 47
 		print("",end="",flush=True)
48
+		# time.sleep(1.5)
49
+
50
+		# p("!!!!!!!!!!!!!!!!!!!!")
51
+		r'''
52
+		await self.send(text_data=json.dumps({
53
+			'wsconn': {"abc.":12}
54
+		}))
55
+		'''
56
+
57
+		# print("",end="",flush=True)
39 58
 		self.accept()
59
+
60
+		r'''
61
+		await self.send(text_data=json.dumps({
62
+			'wsconn': {"abc.":123}
63
+		}))
64
+		'''
65
+
66
+
40 67
 	async def ws_disconn(self, close_code):
41 68
 		pass
69
+
70
+	async def ws_disconn_z(self, close_code):
71
+		pass
72
+
42 73
 	async def ws_rec(self, text_data):
43 74
 		return
44 75
 		p("text_data:",text_data)
@@ -55,4 +86,12 @@ class ChatConsumer():
55 86
 			'zzz': {"abc":123}
56 87
 		}))
57 88
 
58
-Mixins.ChatConsumer = ChatConsumer
89
+
90
+# print(">>>>>>>>>>>>>")
91
+Mixins.ChatConsumer = ChatConsumer
92
+
93
+print("++?",end="\n",flush=True)
94
+# print("++2?",end="\n",flush=True)
95
+
96
+# print("++",end="\n",flush=True)
97
+

読み込み中…
キャンセル
保存