Function

Dex-1Dexthread_spawnSince 1.0

  • Spawns a new thread named thread_name running thread_func with user_data passed to it.

    thread_func must return a Dex.Future.

    If this function is called from a thread that is not running a Dex.Scheduler then the default scheduler will be used to call user_data_destroy.

    If the resulting Dex.Future has not resolved or rejected, then the same scheduler used to call user_data_destroy will be used to propagate the result to the caller.

    Parameters

    • thread_name: string

      the name for the thread

    • thread_func: Dex.ThreadFunc

      the function to call on a thread

    Returns Dex.Future

    a Dex.Future that resolves or rejects the value or error returned from thread_func as a Dex.Future.

    1.0