C# 클래스 UnityTools.Threading.UnityTask

A helper class inspired by the .NET 4.0 Task object and javascript flow libraries such as Q
파일 보기 프로젝트 열기: NoxHarmonium/unity-tools 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_dispatcher IDispatcher
_endCallbacks List
_exception System.Exception
_failureCallbacks List>
_finished bool
_progressCallbacks List>
_result object
_succeeded bool
_successCallbacks List>
_thread Thread
_waitHandle System.Threading.EventWaitHandle

공개 메소드들

메소드 설명
All ( ) : UnityTask

Combines multiple tasks of the same type into one callback and runs them simultaneously. On failure the failure callback is called immediately and the result of the other tasks is discarded.

AllSequential ( ) : UnityTask

Combines multiple tasks of the same type into one callback and runs them sequentially. On failure the failure callback is called immediately and the result of the other tasks is discarded.

Notify ( float progress ) : void

Fire all the progress callbacks with the current progress

Reject ( Exception error ) : UnityTask

Finish the task with an error state

Resolve ( object value = null ) : UnityTask

Finish the task with a result

Then ( Action onFulfilled = null, Action onFailure = null, Action onProgress = null, System.Action onEnd = null ) : UnityTask

Add callbacks that will fire on certain task states. If the task has already completed or failed, the related callbacks will fire immediately. Returns the this task so that calls can be chained together.

UnityTask ( IDispatcher dispatcher = null ) : System

Initializes a new instance of the UnityTask`1 class.

UnityTask ( UnityTaskAutoThreadDelegate taskAction, IDispatcher dispatcher = null ) : System

Initializes a new instance of the UnityTask`1 class which wraps an action, automatically running it on a new thread. All uncaught exceptions thrown in the spawned thread will automatically trigger Task.Reject().

비공개 메소드들

메소드 설명
All ( IDispatcher dispatcher ) : UnityTask

Combines multiple tasks of the same type into one callback and runs them simultaneously. On failure the failure callback is called immediately and the result of the other tasks is discarded.

AllSequential ( IDispatcher dispatcher ) : UnityTask

Combines multiple tasks of the same type into one callback and runs them sequentially. On failure the failure callback is called immediately and the result of the other tasks is discarded.

FireEndCallbacks ( ) : void

Called internally to trigger all the onEnd callbacks

메소드 상세

All() 공개 정적인 메소드

Combines multiple tasks of the same type into one callback and runs them simultaneously. On failure the failure callback is called immediately and the result of the other tasks is discarded.
public static All ( ) : UnityTask
리턴 UnityTask

AllSequential() 공개 정적인 메소드

Combines multiple tasks of the same type into one callback and runs them sequentially. On failure the failure callback is called immediately and the result of the other tasks is discarded.
public static AllSequential ( ) : UnityTask
리턴 UnityTask

Notify() 공개 메소드

Fire all the progress callbacks with the current progress
public Notify ( float progress ) : void
progress float A floating point value representing the current progress
리턴 void

Reject() 공개 메소드

Finish the task with an error state
public Reject ( Exception error ) : UnityTask
error System.Exception Error details.
리턴 UnityTask

Resolve() 공개 메소드

Finish the task with a result
public Resolve ( object value = null ) : UnityTask
value object The result of the task.
리턴 UnityTask

Then() 공개 메소드

Add callbacks that will fire on certain task states. If the task has already completed or failed, the related callbacks will fire immediately. Returns the this task so that calls can be chained together.
public Then ( Action onFulfilled = null, Action onFailure = null, Action onProgress = null, System.Action onEnd = null ) : UnityTask
onFulfilled Action Callback that fires when the task succeeds
onFailure Action Callback that fires when the task fails
onProgress Action Callback that fires when the progress of the task changes
onEnd System.Action Callback that fires when the task succeeds or fails
리턴 UnityTask

UnityTask() 공개 메소드

Initializes a new instance of the UnityTask`1 class.
public UnityTask ( IDispatcher dispatcher = null ) : System
dispatcher IDispatcher
리턴 System

UnityTask() 공개 메소드

Initializes a new instance of the UnityTask`1 class which wraps an action, automatically running it on a new thread. All uncaught exceptions thrown in the spawned thread will automatically trigger Task.Reject().
public UnityTask ( UnityTaskAutoThreadDelegate taskAction, IDispatcher dispatcher = null ) : System
taskAction UnityTaskAutoThreadDelegate The delegate that will be executed on a seperate thread.
dispatcher IDispatcher
리턴 System

프로퍼티 상세

_dispatcher 보호되어 있는 프로퍼티

protected IDispatcher _dispatcher
리턴 IDispatcher

_endCallbacks 보호되어 있는 프로퍼티

protected List _endCallbacks
리턴 List

_exception 보호되어 있는 프로퍼티

protected Exception,System _exception
리턴 System.Exception

_failureCallbacks 보호되어 있는 프로퍼티

protected List> _failureCallbacks
리턴 List>

_finished 보호되어 있는 프로퍼티

protected bool _finished
리턴 bool

_progressCallbacks 보호되어 있는 프로퍼티

protected List> _progressCallbacks
리턴 List>

_result 보호되어 있는 프로퍼티

protected object _result
리턴 object

_succeeded 보호되어 있는 프로퍼티

protected bool _succeeded
리턴 bool

_successCallbacks 보호되어 있는 프로퍼티

protected List> _successCallbacks
리턴 List>

_thread 보호되어 있는 프로퍼티

protected Thread _thread
리턴 Thread

_waitHandle 보호되어 있는 프로퍼티

protected EventWaitHandle,System.Threading _waitHandle
리턴 System.Threading.EventWaitHandle