Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
  • Instead of calling var task = Task.Factory.StartNew(runTask); or like Bruno Costa correctly suggested with a CancellationToken like var task = Task.Factory.StartNew(runTask, cancellationToken); you can here use for NET 4.5 the overloaded Task.Run(Action, CancellationToken) method, which can be seen as a simplified call to Task.Factory.StartNew().

See also : http://stackoverflow.com/a/22087211https://stackoverflow.com/a/22087211

  • By providing a default value for taskName the message of a thrown TaskTimeoutException would look better.

  • Early checking if TimeSpan timeout is in the given range, will reduce overhead.

  • Action runTask should be renamed to runAction or better to just action.

  • Instead of calling var task = Task.Factory.StartNew(runTask); or like Bruno Costa correctly suggested with a CancellationToken like var task = Task.Factory.StartNew(runTask, cancellationToken); you can here use for NET 4.5 the overloaded Task.Run(Action, CancellationToken) method, which can be seen as a simplified call to Task.Factory.StartNew().

See also : http://stackoverflow.com/a/22087211

  • By providing a default value for taskName the message of a thrown TaskTimeoutException would look better.

  • Early checking if TimeSpan timeout is in the given range, will reduce overhead.

  • Action runTask should be renamed to runAction or better to just action.

  • Instead of calling var task = Task.Factory.StartNew(runTask); or like Bruno Costa correctly suggested with a CancellationToken like var task = Task.Factory.StartNew(runTask, cancellationToken); you can here use for NET 4.5 the overloaded Task.Run(Action, CancellationToken) method, which can be seen as a simplified call to Task.Factory.StartNew().

See also : https://stackoverflow.com/a/22087211

  • By providing a default value for taskName the message of a thrown TaskTimeoutException would look better.

  • Early checking if TimeSpan timeout is in the given range, will reduce overhead.

  • Action runTask should be renamed to runAction or better to just action.

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link
  • Instead of calling var task = Task.Factory.StartNew(runTask); or like Bruno CostaBruno Costa correctly suggested with a CancellationToken like var task = Task.Factory.StartNew(runTask, cancellationToken); you can here use for NET 4.5 the overloaded Task.Run(Action, CancellationToken) method, which can be seen as a simplified call to Task.Factory.StartNew().

See also : http://stackoverflow.com/a/22087211

  • By providing a default value for taskName the message of a thrown TaskTimeoutException would look better.

  • Early checking if TimeSpan timeout is in the given range, will reduce overhead.

  • Action runTask should be renamed to runAction or better to just action.

  • Instead of calling var task = Task.Factory.StartNew(runTask); or like Bruno Costa correctly suggested with a CancellationToken like var task = Task.Factory.StartNew(runTask, cancellationToken); you can here use for NET 4.5 the overloaded Task.Run(Action, CancellationToken) method, which can be seen as a simplified call to Task.Factory.StartNew().

See also : http://stackoverflow.com/a/22087211

  • By providing a default value for taskName the message of a thrown TaskTimeoutException would look better.

  • Early checking if TimeSpan timeout is in the given range, will reduce overhead.

  • Action runTask should be renamed to runAction or better to just action.

  • Instead of calling var task = Task.Factory.StartNew(runTask); or like Bruno Costa correctly suggested with a CancellationToken like var task = Task.Factory.StartNew(runTask, cancellationToken); you can here use for NET 4.5 the overloaded Task.Run(Action, CancellationToken) method, which can be seen as a simplified call to Task.Factory.StartNew().

See also : http://stackoverflow.com/a/22087211

  • By providing a default value for taskName the message of a thrown TaskTimeoutException would look better.

  • Early checking if TimeSpan timeout is in the given range, will reduce overhead.

  • Action runTask should be renamed to runAction or better to just action.

edited body
Source Link
Heslacher
  • 51k
  • 5
  • 83
  • 177
  • Instead of calling var task = Task.Factory.StartNew(runTask); or like Bruno Costa correctly suggested with a CancellationToken like var task = Task.Factory.StartNew(runTask, cancellationToken); you can here use for NET 4.5 the overloaded Task.Run(Action, CancellationToken) method.
    , Thiswhich can be seen as a simplified call to Task.Factory.StartNew().

See also : http://stackoverflow.com/a/22087211

  • By providing a default value for taskName the message of a thrown TaskTimeoutException would look better.

  • Early checking if TimeSpan timeout is in the given range, will reduce overhead.

  • Action runTask should be renamed to runAction or better to just action.

  • Instead of calling var task = Task.Factory.StartNew(runTask); or like Bruno Costa correctly suggested with a CancellationToken like var task = Task.Factory.StartNew(runTask, cancellationToken); you can here use for NET 4.5 the overloaded Task.Run(Action, CancellationToken) method.
    This can be seen as a simplified call to Task.Factory.StartNew().

See also : http://stackoverflow.com/a/22087211

  • By providing a default value for taskName the message of a thrown TaskTimeoutException would look better.

  • Early checking if TimeSpan timeout is in the given range, will reduce overhead.

  • Action runTask should be renamed to runAction or better to just action.

  • Instead of calling var task = Task.Factory.StartNew(runTask); or like Bruno Costa correctly suggested with a CancellationToken like var task = Task.Factory.StartNew(runTask, cancellationToken); you can here use for NET 4.5 the overloaded Task.Run(Action, CancellationToken) method, which can be seen as a simplified call to Task.Factory.StartNew().

See also : http://stackoverflow.com/a/22087211

  • By providing a default value for taskName the message of a thrown TaskTimeoutException would look better.

  • Early checking if TimeSpan timeout is in the given range, will reduce overhead.

  • Action runTask should be renamed to runAction or better to just action.

Source Link
Heslacher
  • 51k
  • 5
  • 83
  • 177
Loading