What is a good way to work with TPL that does not do anything manually, but wait completely To return any other event to the system, with the data of the task to trigger it?
If the triggering event is itself The closest I could have come is to create a task that is executed when a fee is returned by an ineligible object. Here's an example using object 1-element array as an object: Somewhere else in the code, when the event occurs, the contents of the container's content Is set and the task begins: Left- Nostrilic code odor: to start the job and its entry point After executing the policy, no actual work is done in the work. Correct nose code: The holder object whose sole purpose is to include a functional return value. / P> Does anyone care to clean the air? use When the event occurs, set the result like this: work or
IAsyncResult pattern which expects, then support is created. But is the incident different? Dissatisfied solution:
var work = new work & lt; ReturnType & gt; (Results dialog => ([ReturnType []) Results dialog [0], New ReturnType [1]);
((ReturnType [] Task.AsyncState) [0] = theResult; task.Start (); < P>
Task end source & lt; T & gt; Create the source like this:
var source = new function end source & lt; ReturnType & gt; (); Work = source. Task; // Stop the wait code
source.SetResult (theResult);
No comments:
Post a Comment