Batching
- Overview
- API
- Example
Uni Task provides an easy way to achive multi-threading using UniTask.RunOnThreadPool()
.
CBSL extension for UniTask provides batching API to split tasks on multiple threads.
#
Batch SchedulerBatchScheduler.Process()
takes in a IEnumerable<I>
Where I
represents input data, then it divides the data into batches
and processes each batch on seprate threads.
The process method has 2 overloads :-
the difference between the two is in the for each process, one takes a Func<I, O>
and one takes an Action<I>
.
Use the Func overload if you want your tasks to return something, the result is also an array corresponding to each input.
PreProcess & PostProcess callbacks are run on main thread for each batch and can be null.
working on a tool to auto-generate api docs.