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); }
public void SimpleWorker() { var worker = new GearmanWorker("gearmanCluster"); worker.RegisterFunction("reverse", ReverseFunction); while (/* we should continue working is */ true) { worker.Work(); } }