Description
The WaitForCompile
method is an asynchronous operation that waits for the compilation process to complete within a CompileGroup
. This method is useful when you need to ensure that all compilation tasks have finished before proceeding with further operations. It accepts a CancellationToken
parameter, allowing the operation to be cancelled if needed.
Usage
To use the WaitForCompile
method, you need to have an instance of CompileGroup
. Call this method when you want to wait for all compilation tasks to complete. You can pass a CancellationToken
to handle cancellation scenarios.
Example
// Example of using WaitForCompile
public async Task ExampleUsageAsync(CancellationToken cancellationToken)
{
// Assume compileGroup is an instance of CompileGroup
CompileGroup compileGroup = new CompileGroup();
// Start some compilation tasks
await compileGroup.BuildAsync();
// Wait for all compilation tasks to complete
await compileGroup.WaitForCompile(cancellationToken);
// Proceed with further operations after compilation is complete
if (compileGroup.BuildResult.Success)
{
// Handle successful compilation
}
else
{
// Handle compilation errors
}
}