public TaskHandle(ClientHandle clientHandle, UserTask task, object userState, Action <TaskStatus> callback) { ClientHandle = clientHandle; Task = task; UserState = userState; Callback = callback; }
public static ClientHandle QueueUserTask(UserTask task, object userState, Action <TaskStatus> callback) { InitializeThreadPool(); ClientHandle clientHandle = new ClientHandle(Guid.NewGuid()); TaskHandle taskHandle = new TaskHandle(clientHandle, task, userState, callback); lock (_queueLock) { _readyQueue.Enqueue(taskHandle); } return(clientHandle); }