22

关于原生workerman长连接中使用redis和mysql的问题!

 4 years ago
source link: https://www.oschina.net/question/2767226_2321319
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

关于原生workerman长连接中使用redis和mysql的问题!

打飞机的猪猪侠 发布于 昨天 11:37


请教一下各位大神,因为第一次接触workerman,就是在做长连接的时候,当客户端发送过来消息的时候,我需要把数据实时储存在redis或者mysql当中,但是redis和mysql有时候会因为超时问题断开,然后在重连,这段时间断开和重连间隔当中如果有人再次发消息,那么就会造成消息延迟发送出去,因为在这里面处理了业务数据库,请问有什么好的办法解决吗? 以下是长连中操作的业务代码: (代码写的垃圾,请见谅)







天1之1涯
昨天 16:48

onWorkerStart 这里设置一个定时任务,每隔一秒让mysql执行一下select 1  from xx

xiaochong0302
今天 10:27  iPhone
使用gateway-woker 配合ajax 就降级为平常的web编程模式了,或者捕获异常重连喽
©OSCHINA(OSChina.NET)
开源软件推进联盟
指定官方社区

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK