JobQueue.Run C# (CSharp) Method

Run() public method

public Run ( ) : void
return void
        public void Run()
        {
            while (run)
            {
                
                    Exception job = (pendingJobs.Count > 0) ? pendingJobs.Dequeue() : defaultJob;
                    
                    if (job!= null)
                    {
                      ////what to do with current Exception
                     }
                
                Thread.Sleep(20); //I know this is bad...
            }
            
            
            pendingJobs.Clear();
        }
    }

Usage Example

Example #1
0
 public void Load()
 {
     JobQueue.Run(() => BiomeTerrainChunkGenerator.GenerateChunkData(startPoint, coord, worldSettings), this.OnHeightMapReceived);
 }
All Usage Examples Of JobQueue::Run