1

现在我只想使用 Gearman 进行后台处理。例如,一旦发件人将他们的消息提交到数据库中,我需要向收件人发送电子邮件,告知他们有一条私人消息在等待他们。我假设我可以在我的主服务器上运行工作程序/客户端和服务器,但是将一些任务卸载到不同的 Web 服务器上没有问题。

无论如何,我的问题是如何处理多个“功能”?假设我需要一份处理电子邮件部分的工作和一份处理图像处理的工作。我可以在工作人员中拥有多种功能吗?我遵循了我在网上找到的几个示例,但每个示例仅显示一个正在初始化的函数。我是否必须启动多个“工人”来处理多个功能?

4

1 回答 1

1

Can I have multiple functions in the worker? I've followed a couple of examples I found online but each example only shows one function being initialized.

When you register with the Gearman server, you tell it all the things you can handle. Check out the GearmanWorker class and the addFunction method. (This blindly assumes you're using that particular Gearman extension. There are others.)

于 2010-06-02T03:30:24.857 回答