napi_call_threadsafe_function_with_priority

Function napi_call_threadsafe_function_with_priority 

Source
pub unsafe extern "C" fn napi_call_threadsafe_function_with_priority(
    func: napi_threadsafe_function,
    data: *mut c_void,
    priority: napi_task_priority,
    isTail: bool,
) -> napi_status
Available on crate features napi and api-12 only.
Expand description

Dispatch a task with specified priority from a native thread to an ArkTS thread, the task will execute the given thread safe function.

§Arguments

  • func - Indicates the thread safe function.

  • data - Indicates the data anticipated to be transferred to the ArkTS thread.

  • priority - Indicates the priority of the task dispatched.

  • isTail - Indicates the way of the task dispatched into the native event queue. When “isTail” is true, the task will be dispatched to the tail of the native event queue. Conversely, when “isTail” is false, the tasks will be dispatched to the head of the native event queue.

§Returns

  • Return the function execution status.

Available since API-level: 12