Skip to content

服务端多进程处理任务demo,用来学习&测试

Notifications You must be signed in to change notification settings

luzzhong/server_job

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

server_job

利用swoole实现任务投递,多进程处理任务

demo中利用client投递任务,socket_server负责建立通讯,Job负责拉起manager进程、worker进程,进程内部通过消息队列传递数据
实现根据任务量大小来决定是否fork新worker进程以及回收多余worker进程,监听master进程异常退出,当woker处理完成任务后终止程序运行
socket_server通过stream_context_set_option()来实现负载均衡、设置连接重用
worker为争抢模式

About

服务端多进程处理任务demo,用来学习&测试

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages