Exemplo n.º 1
0
        public void SimpleWorker()
        {
            var worker = new GearmanWorker("gearmanCluster");
            worker.RegisterFunction("reverse", ReverseFunction);

            while (/* we should continue working is */ true)
            {
                worker.Work();
            }
        }
        /// <summary>
        /// Create a Gearman worker connection.
        /// </summary>
        /// <param name="configurations"></param>
        /// <returns>GearmanWorker with servers added</returns>
        public static GearmanWorker createWorkerConnectionUsingGearman(GearmanServerConfiguration[] configurations)
        {
            var worker = new GearmanWorker();

            foreach (var config in configurations)
            {
                worker.AddServer(config.Host, config.Port);
            }

            return(worker);
        }
Exemplo n.º 3
0
        public void SimpleWorker()
        {
            var worker = new GearmanWorker("gearmanCluster");

            worker.RegisterFunction("reverse", ReverseFunction);

            while (/* we should continue working is */ true)
            {
                worker.Work();
            }
        }