非阻塞函数PHP [英] Non blocking functions PHP

查看:85
本文介绍了非阻塞函数PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,在该项目中,用户通过表单上传图像,而服务器则提供一些缩略图.缩略图制作过程非常缓慢,因此我认为使用非阻塞功能调整图像大小可能是一个不错的解决方案.我的意思是:服务器处理表单(其中包含更多字段)会向用户提供确定"的反馈,然后调用缩略图功能.我该怎么办?

I have a project in which a user uploads an image through a form and the server does some thumbnails. The thumbnail making process is very slow so I thought that doing the image resizing with a non-blocking function could be a good solution. I mean: the server process the form (wich have more fields) gives the "ok" feedback to the user and then calls the thumbnailing function. How can I do that?

预先感谢

推荐答案

您最好的选择是实施Gearman.这是一个Job Queue系统,您可以在其中实现异步作业的同步. http://gearman.org/

Your best option would be to implement Gearman. It's a Job Queue system where you can implement either synchronous of asynchronous jobs. http://gearman.org/

这篇关于非阻塞函数PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆