Sunday, 15 May 2011

c# - Is there a way of setting a Task driven via TaskCompletionSource to Status 'Running'? -



c# - Is there a way of setting a Task driven via TaskCompletionSource to Status 'Running'? -

i'm using taskcompletionsource provide , drive instance of task. able set task status running indicate task is... 'running' can't see way accomplish via taskcompletionsource.

is there way this?

no. there isn't way.

whether or not answer, however, right one. :-)

the next opinion, , effort help sense better.

task.status has several states set , useful when task scheduled task. tasks taskcompletionsource not scheduled tasks. concept of waitingtorun, running, etc. hence not applicable in traditional scheduled task sense. if did have ability set these, you'd have decide on semantics apply these values, may conflict how others interpret them.

ultimately, don't think code should ever create decisions based on these intermediate states anyway. doing sounds "code smell".

c# task-parallel-library

No comments:

Post a Comment