Skip to main content
typo
Source Link
rolfl
  • 97.5k
  • 17
  • 218
  • 418

Currently, you'reyour setup doesn't allow for any cancellation or error handling. The latter is an implementation detail, so I guess you've handled that in the actual code. I would consider the following:

  • Return the started task out of Start
  • Will you ever need to provide a result from the started task? If so, provide an overload for Func<double,T>
  • Provide cancellation support via a cancellation token (if business logic dictates this is acceptable)
  • Provide a Stop method that also that can stop the task created by Start

Currently, you're setup doesn't allow for any cancellation or error handling. The latter is an implementation detail, so I guess you've handled that in the actual code. I would consider the following:

  • Return the started task out of Start
  • Will you ever need to provide a result from the started task? If so, provide an overload for Func<double,T>
  • Provide cancellation support via a cancellation token (if business logic dictates this is acceptable)
  • Provide a Stop method that also that can stop the task created by Start

Currently, your setup doesn't allow for any cancellation or error handling. The latter is an implementation detail, so I guess you've handled that in the actual code. I would consider the following:

  • Return the started task out of Start
  • Will you ever need to provide a result from the started task? If so, provide an overload for Func<double,T>
  • Provide cancellation support via a cancellation token (if business logic dictates this is acceptable)
  • Provide a Stop method that also that can stop the task created by Start
Source Link

Currently, you're setup doesn't allow for any cancellation or error handling. The latter is an implementation detail, so I guess you've handled that in the actual code. I would consider the following:

  • Return the started task out of Start
  • Will you ever need to provide a result from the started task? If so, provide an overload for Func<double,T>
  • Provide cancellation support via a cancellation token (if business logic dictates this is acceptable)
  • Provide a Stop method that also that can stop the task created by Start