Search Unity

Feature Request Should be have IPostprocessBuildWithReportAsync ?

Discussion in 'Testing & Automation' started by Thaina, Jan 20, 2020.

  1. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    361
    Similar to `IPostprocessBuildWithReport` but with `Task` as return type. So we could write some non blocking async code in the processing logic

    Code (CSharp):
    1.  
    2. public interface IPostprocessBuildWithReport : IOrderedCallback
    3. {
    4.     TimeSpan? TimeOut { get; } // for skip when too long. Return null for default
    5.     Task OnPostprocessBuild(BuildReport report);
    6. }
    7.  
     
  2. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,264
    The build pipeline would need to block until your task is finished running anyway, so I don't think there's much point.
     
  3. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    361
    First, it difference between a task blocking and IO blocking (await is not IO blocking in the thread)
    Second, it would be better if we could write `async/await` function directly, instead of the need to wrapping it in `Task.Run`
    Third, I think `async Task` function should actually be promoted to be default processor function. Eventually the current one should be deprecated
     
    Last edited: Jan 22, 2020
unityunity