public void can_fetch_jobstatus()
        {
            var client = new GearmanClient();
            client.AddServer(Helpers.TestServerHost, Helpers.TestServerPort);
            var jobRequest = client.SubmitBackgroundJob("reverse", Encoding.ASCII.GetBytes("Hello World"));
            var jobStatus = client.GetStatus(jobRequest);

            Assert.IsNotNull(jobStatus);
            // We can't safely assert that jobStatus.IsKnown is true, but it most likely should be.
        }
示例#2
0
        public void can_fetch_jobstatus()
        {
            var client = new GearmanClient();

            client.AddServer(Helpers.TestServerHost, Helpers.TestServerPort);
            var jobRequest = client.SubmitBackgroundJob("reverse", Encoding.ASCII.GetBytes("Hello World"));
            var jobStatus  = client.GetStatus(jobRequest);

            Assert.IsNotNull(jobStatus);
            // We can't safely assert that jobStatus.IsKnown is true, but it most likely should be.
        }
示例#3
0
        private static void CreateBackgroundJobs(GearmanClient client, int jobCount)
        {
            for (int i = 0; i < jobCount; i++)
            {
                var request = client.SubmitBackgroundJob("reverse_with_status", Encoding.UTF8.GetBytes(String.Format("{0}: Hello World", i)));

                GearmanJobStatus jobStatus;
                do
                {
                    jobStatus = client.GetStatus(request);
                }while (jobStatus.IsKnown && jobStatus.IsRunning);

                Console.WriteLine("Submitted background job. Handle: {0}", request.JobHandle);
            }
        }
示例#4
0
        private static void CreateBackgroundJobs(GearmanClient client, int jobCount)
        {
            for (int i = 0; i < jobCount; i++)
            {
                var request = client.SubmitBackgroundJob("reverse_with_status", Encoding.UTF8.GetBytes(String.Format("{0}: Hello World", i)));

                GearmanJobStatus jobStatus;
                do
                {
                    jobStatus = client.GetStatus(request);
                }
                while (jobStatus.IsKnown && jobStatus.IsRunning);

                Console.WriteLine("Submitted background job. Handle: {0}", request.JobHandle);
            }
        }