How to perform Raycast inside IJobParallelFor ?

I’m testing Unity.Jobs and I’m trying to perform Raycast inside the IJobParallelFor.Execute function.
When I tried to call the Raycast API inside the Execute function I got this error. “UnityException: INTERNAL_CALL_Internal_RaycastTest can only be called from the main thread.”

During this presentation Unite Austin 2017 - Massive Battle in the Spellsouls Universe, they mentioned a new “batched raycasts” Api, but I can’t find it in the documentation.
if anyone got an idea or an example please let me know. Thanks

The documentation for the batched raycasts is at Unity - Scripting API: RaycastCommand .

You cannot call it from within an IJobParallelFor, you need to schedule the batch from the main thread and setup dependency chains if you want to prepare the commands or process the results in jobs.