Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Threading

Module used to create and manipulate threads. Threads let you execute time-consuming tasks without blocking current execution thread

Index

Type aliases

ErrorMessageFormatFunction

ErrorMessageFormatFunction: (error: any, priority: number) => string

Function used to format error messages in a custom way

Type declaration

    • (error: any, priority: number): string
    • Parameters

      • error: any

        java.lang.Throwable instance or javascript exception

      • priority: number

        current thread priority

      Returns string

Functions

formatFatalErrorMessage

  • Function used to create formatted error message with the full debug information about exception in one of the threads. Usually called by Core Engine

    Parameters

    • error: any

      java.lang.Throwable instance or javascript exception

    • name: string

      thread name used to localize errors if there are any

    • priority: number

      current thread priority

    • formatFunc: ErrorMessageFormatFunction

      function that formats the exception itself

    Returns string

getThread

  • getThread(name: string): Thread
  • Gets thread by its name

    Parameters

    • name: string

      name of the thread

    Returns Thread

    java.lang.Thread instance representing the thread

initThread

  • initThread(name: string, func: () => void, priority?: number, isErrorFatal?: boolean, formatFunc?: ErrorMessageFormatFunction): Thread
  • Creates and runs new thread with specified function as a task

    Parameters

    • name: string

      thread name used to localize errors if there are any

    • func: () => void

      function that runs in the new thread. Usually it is some time-consuming task, that is executed in the new thread to avoid blocking user interfaces

        • (): void
        • Returns void

    • Optional priority: number

      priority of the thread (integer value). The higher priority is, the quicker the task will be executed. Default value is 0

    • Optional isErrorFatal: boolean

      if true, all errors in the thread are considered fatal and lead to fatal error AlertDialog, formatted with formatFunc

    • Optional formatFunc: ErrorMessageFormatFunction

      function that formats exceptions in the thread to display in fatal error AlertDialog

    Returns Thread

    java.lang.Thread instance representing created thread

Generated using TypeDoc