handle_info 和handle_call里调用call 会超时

本文探讨了handle_call作为同步调用机制为何不宜直接调用,以及在handle_info和handle_call内部再次调用call可能导致的超时问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

handle_call是同步调用,肯定不能call,

。。。。。

handle_info 和handle_call里调用call 会超时。。。。

你给到代码出现了: --- Logging error --- Traceback (most recent call last): File "D:\Develop\Python\Python38\lib\logging\__init__.py", line 1088, in emit stream.write(msg + self.terminator) TypeError: a bytes-like object is required, not 'str' Call stack: File "1.py", line 244, in <module> server = mysql_listener() File "1.py", line 231, in __init__ log.info("Listening on port %d", PORT) Message: 'Listening on port %d' Arguments: (3306,) --- Logging error --- Traceback (most recent call last): File "D:\Develop\Python\Python38\lib\logging\__init__.py", line 1088, in emit stream.write(msg + self.terminator) TypeError: a bytes-like object is required, not 'str' Call stack: File "1.py", line 247, in <module> asyncore.loop() File "D:\Develop\Python\Python38\lib\asyncore.py", line 203, in loop poll_fun(timeout, map) File "D:\Develop\Python\Python38\lib\asyncore.py", line 150, in poll read(obj) File "D:\Develop\Python\Python38\lib\asyncore.py", line 83, in read obj.handle_read_event() File "D:\Develop\Python\Python38\lib\asyncore.py", line 414, in handle_read_event self.handle_accept() File "1.py", line 239, in handle_accept log.info('Connection from: %r', pair[1]) Message: 'Connection from: %r' Arguments: (('127.0.0.1', 55143),) --- Logging error --- Traceback (most recent call last): File "1.py", line 199, in found_terminator raise LastPacket() LastPacket During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\Develop\Python\Python38\lib\logging\__init__.py", line 1088, in emit stream.write(msg + self.terminator) TypeError: a bytes-like object is required, not 'str' Call stack: File "1.py", line 247, in <module> asyncore.loop() File "D:\Develop\Python\Python38\lib\asyncore.py", line 203, in loop poll_fun(timeout, map) File "D:\Develop\Python\Python38\lib\asyncore.py", line 150, in poll read(obj) File "D:\Develop\Python\Python38\lib\asyncore.py", line 83, in read obj.handle_read_event() File "D:\Develop\Python\Python38\lib\asyncore.py", line 420, in handle_read_event self.handle_read() File "D:\Develop\Python\Python38\lib\asynchat.py", line 151, in handle_read self.found_terminator() File "1.py", line 205, in found_terminator log.info('Last packet') Message: 'Last packet' Arguments: () 这些错误
最新发布
07-11
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值