gearman
-
There are many possible uses for Gearman in a Web application .
在一个Web应用程序内可能有许多地方都会用到Gearman。
-
Gearman also includes the ability to initiate a background process .
Gearman也能够初始化background进程。
-
As mentioned earlier , a Gearman configuration has three kinds of actors
我们前面提到过,一个Gearman配置有三个角色
-
The Gearman library for PHP distributes work among a collection of machines .
PHP的Gearman库能把工作分发给一组机器。
-
You have a standard Gearman environment using your standard group of workers serving the needs of your clients .
您具有一个标准的Gearman环境,使用标准工人组来满足客户机的需求。
-
Gearman doesn 't do any form of translation or manipulation of the data exchanged .
Gearman不进行所交换数据的任何转换或操作。
-
Let 's have a look at some more examples of Gearman deployments .
下面我们来看其他一些Gearman部署的例子。
-
So far , you have looked at ways of using Gearman where you want or need an immediate response .
到目前为止,已经了解在想要或需要即时响应的时候使用Gearman的方式。
-
Gearman takes a different approach by providing a flexible mechanism for distributing discrete tasks around a group of machines .
Gearman采用与之不同的方法,它为跨一组机器分布离散的任务提供一种灵活的机制。
-
Run a worker with the command-line utility gearman .
用命令行实用工具gearman运行一个worker。
-
Using Gearman across environments
跨环境使用Gearman
-
The easiest way to see how Gearman works is to try a simple application that makes use of the Gearman service .
了解Gearman如何工作最容易的方式是,尝试一个使用Gearman服务的简单应用程序。
-
Moreover , because the Gearman protocol is language and platform independent , you can mix programming languages in your solution .
而且,由于Gearman协议是独立于语言和平台的,所以您可以在解决方案中混合编程语言。
-
This makes Gearman useful in grid environments or Web environments where you want to share and distribute work and requests .
这使得Gearman在网格环境或Web环境中很有用&在这样环境中,您想要共享和分布工作及请求。
-
For the former , the Gearman work queue remains in memory but is backed by a relational database .
对于前者,Gearman工作队列保存在内存并在一个关系型数据库内存有备份。
-
If the version number matches that of the Gearman library you built and installed previously , your system is ready .
如果这个版本号与之前构建和安装的Gearman库的版本号相匹配,那么系统就已准备好了。
-
You create a Gearman Client object , specify the servers , and call the task that you want to perform .
您创建一个GearmanClient对象,指定服务器,调用您想要执行的任务。
-
This is particularly important since the default port number used for Gearman changed , and this can lead to problems with the system not working .
由于用于Gearman的默认端口号改变了,所以这一点特别重要,这会导致系统不能工作的问题。
-
Future releases of Gearman will collect and report statistics , provide advanced monitoring , and cache job results , among other things .
Gearman的未来版本将收集并报告统计数据、提供高级监视和缓存作业结果等。
-
When used in a cloud environment , you use the flexible nature of Gearman to ramp up the available workers when you need them .
在云环境中使用时,您利用Gearman的灵活特点来运行可用的工人。
-
All that 's needed to add workers to the Gearman system is for the worker script to be executed during boot time .
将工人添加到Gearman系统所需要做的就是让工人脚本在引导时间执行。
-
Thus , if the Gearman daemon fails , it can recreate the work queue on restart .
这样一来,如果Gearman守护程序故障,它就可以在重启后重新创建这个工作队列。
-
To run the other script , all you need are the Gearman libraries , script modules , and the script itself .
要运行另外的脚本,您所需要的只有Gearman库、脚本模块和脚本本身。
-
Using Gearman from PHP is similar to the previous example , except that you create the producer and consumer actors in PHP .
从PHP使用Gearman类似于之前的示例,惟一的区别在于这里是在PHP内创建producer和consumer。
-
The Gearman daemon is commonly installed in / usr / sbin .
这个Gearman守护程序通常被安装在/usr/sbin。
-
Gearman is a nascent but capable work-distribution system .
Gearman是一个刚刚起步却很有实力的工作分发系统。
-
Recent releases of Gearman have expanded the system 's features to include persistent job queues and a new protocol to submit work requests via HTTP .
Gearman的最新版本已经将系统特性扩展到了包含持久的作业队列和用一个新协议来通过HTTP提交工作请求。
-
Gearman queues jobs and doles out assignments , distributing onerous tasks to machines set aside for the task .
Gearman会对作业进行排队并少量分派作业,而将那些复杂的任务分发给为此任务预留的机器。
-
For example , if you are providing or using Twitter integration , you can use Gearman to handle the posting to the Twitter account .
例如,如果您在提供或使用Twitter集成,那么可以使用Gearman来处理到Twitter帐户的发布。
-
Assuming that you host your PHP applications on a typical LAMP configuration , Gearman requires an additional daemon and a PHP extension .
假设您将PHP应用程序托管在一个典型的LAMP配置上,那么Gearman将需要一个额外的守护程序以及一个PHP扩展。