Skip to main content
Version: 21 Aug 2024

MLThreadDispatch

NameSpace: Native

Handles dispatching calls from the Magic Leap native thread to the Unity thread

Public Methods

void Call

A method that queues an action without a payload

public static void Call(
System.Delegate callback
)

Parameters

TypeNameDescription
System.DelegatecallbackA callback function to be called when the delegate is invoked

void Call

A method that queues an action without a payload

public static void Call(
System.Action callback
)

Parameters

TypeNameDescription
System.ActioncallbackA callback function to be called when the action is invoked

void Call< A >

A template method that queues an action with a single payload

public static void Call< A >(
A a,
System.Delegate callback
)

Parameters

TypeNameDescription
AaPayload 1
System.DelegatecallbackA callback function to be called when the delegate is invoked

Template Parameters:

  • A Payload type

void Call< A, B >

A template method that queues an action with two payloads

public static void Call< A, B >(
A a,
B b,
System.Delegate callback
)

Parameters

TypeNameDescription
AaPayload 1
BbPayload 2
System.DelegatecallbackA callback function to be called when the delegate is invoked

Template Parameters:

  • A First payload type
  • B Second payload type

void Call< A, B, C >

A template method that queues an action with three payloads

public static void Call< A, B, C >(
A a,
B b,
C c,
System.Delegate callback
)

Parameters

TypeNameDescription
AaPayload 1
BbPayload 2
CcPayload 3
System.DelegatecallbackA callback function to be called when the delegate is invoked

Template Parameters:

  • A First payload type
  • B Second payload type
  • C Third payload type

void Call< A, B, C, D >

A template method that queues an action with four payloads

public static void Call< A, B, C, D >(
A a,
B b,
C c,
D d,
System.Delegate callback
)

Parameters

TypeNameDescription
AaPayload 1
BbPayload 2
CcPayload 3
DdPayload 4
System.DelegatecallbackA callback function to be called when the delegate is invoked

Template Parameters:

  • A First payload type
  • B Second payload type
  • C Third payload type
  • D Forth payload type

void Call< A, B, C, D, E >

A template method that queues an action with five payloads

public static void Call< A, B, C, D, E >(
A a,
B b,
C c,
D d,
E e,
System.Delegate callback
)

Parameters

TypeNameDescription
AaPayload 1
BbPayload 2
CcPayload 3
DdPayload 4
EePayload 5
System.DelegatecallbackA callback function to be called when the delegate is invoked

Template Parameters:

  • A First payload type
  • B Second payload type
  • C Third payload type
  • D Forth payload type
  • E Fifth payload type

void Call< A, B, C, D, E, F >

A template method that queues an action with six payloads

public static void Call< A, B, C, D, E, F >(
A a,
B b,
C c,
D d,
E e,
F f,
System.Delegate callback
)

Parameters

TypeNameDescription
AaPayload 1
BbPayload 2
CcPayload 3
DdPayload 4
EePayload 5
FfPayload 6
System.DelegatecallbackA callback function to be called when the delegate is invoked

Template Parameters:

  • A First payload type
  • B Second payload type
  • C Third payload type
  • D Forth payload type
  • E Fifth payload type
  • F Sixth payload type

void DispatchAll

Dispatch all queued items

public static void DispatchAll()

void ScheduleGraphics

public static void ScheduleGraphics(
System.Action callback
)

Parameters

TypeNameDescription
System.Actioncallback

void ScheduleMain

A method that schedules a callback on the main thread.

public static void ScheduleMain(
System.Action callback
)

Parameters

TypeNameDescription
System.ActioncallbackA callback function to be called when the action is invoked

void ScheduleWork

A method that schedules a callback on the worker thread.

public static void ScheduleWork(
Func< bool > function
)

Parameters

TypeNameDescription
Func< bool >functionFunction to call. Return TRUE when processing is done, FALSE to be placed back in the queue to be called again at a later time.