Git Product home page Git Product logo

dotnet-threading's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dotnet-threading's Issues

Singleton tasks can be disposed

Since Task instances can be disposed, it is possible for a misuse of a cached Task returned by a CompletedTask method or property to cause cascading failures across an application relying on this feature.

Cannot install NuGet package in Flurl PCL project

Attempting to install this library in the Flurl.Http.PCL project produces the following output:

Installing 'Rackspace.Threading 1.0.0'.
Successfully installed 'Rackspace.Threading 1.0.0'.
Adding 'Rackspace.Threading 1.0.0' to Flurl.Http.PCL.
Uninstalling 'Rackspace.Threading 1.0.0'.
Successfully uninstalled 'Rackspace.Threading 1.0.0'.
Install failed. Rolling back...
Could not install package 'Rackspace.Threading 1.0.0'. You are trying to install this package into a project that targets 'portable-net45+sl50+win+wpa81+wp80', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Improve signing policy for API-compatible builds

Following the implementation of #67, all builds of this library except for the .NET 3.5 build will be forwards-binary-compatible. Only two strong name keys are needed:

  1. One for the .NET 3.5 build
  2. One for all other builds

Include CancellationTokenSourceExtensions in all builds

Currently the CancellationTokenSourceExtensions class is omitted from builds targeting versions of the .NET Framework which include the CancellationTokenSource.CancelAfter method. To ensure the binary compatibility promise described in #69 holds, this class should be included in all releases; the implementation for .NET 4.5 can simply delegate the call to CancellationTokenSource.CancelAfter.

Additional Using overloads

Consider providing overloads for TaskBlocks.Using where the body function returns a TResult value instead of a Task<TResult>.

Move Task Building Block methods to their own class

Currently, the Task Building Block methods Using and While are part of the CoreTaskExtensions class. This is confusing because it combines the functionality for Extension Methods for Task Continuations and for Task Building Blocks, which are logically separate features as described in the User Guide.

The Task Building Block methods should be refactored to their own class, the name of which is yet to be determined.

Exceptions from faulted tasks are not always observed

Prior to .NET 4.5, failing to access the Exception property of a faulted task would result in the process being terminated. It's essential that users running code in these environments be certain all faulted tasks will be properly observed.

In most cases, this library already works well because a key objective is properly propagating the state of an antecedent task to a result task. However, there are several cases where problems can occur:

  1. If an antecedent task enters the faulted state, but the final result is propagated from a continuation task which ignores the antecedent, the antecedent needs to at least be observed.
  2. The implementation of TaskBlocks.While has several cases where the Finally extension method is used to transfer task state. If the antecedent to Finally is faulted, then the result of Finally will also enter the faulted state regardless of the implementation of the Finally action.

Validate publicKeyToken in push.ps1

The PowerShell script to push a package to NuGet should verify that the contained assemblies use the expected publicKeyToken value in their strong names, to ensure the assembly versioning expectations are met.

Improve signing policy for prereleases

Prerelease versions of the library should not use the same strong name keys as final releases. This became apparent when solving a bug in another library which uses a similar versioning model to this library. In that case, a particular extension to Visual Studio included a prerelease build of the library. When used with other extensions, Visual Studio would occasionally load the prerelease library in place of the final release, causing extension which (properly) relied on the final release to not work properly.

Once implemented, this functionality will also address the final major concern blocking the inclusion of project-specific strong name keys within the repository itself.

Include StreamExtensions in all builds

Currently the StreamExtensions class is omitted from builds targeting certain versions of the .NET Framework. To ensure the binary compatibility promise described in #69 holds, this class should be included in all releases.

Add `Catch` extension methods

The library currently includes several Finally extension methods. It would be useful to include Catch<TException> methods as well.

  • If an antecedent task finishes in the RanToCompletion state, the Catch handlers are not evaluated.
  • If the Task<TResult>.Exception.InnerExceptions property contains exactly one exception, it is unwrapped prior to executing the handlers. Otherwise, the AggregateException is not unwrapped prior to exception handling.

Improve compatibility with Microsoft.Bcl

The IProgress<T> type is not currently a drop-in replacement for System.IProgress<T>, and values implementing one of these do not implement the other. By using the IProgress<T> type defined in .NET 4.5, or in Microsoft.Bcl for .NET 4.0, all versions of this library except the .NET 3.5 target will use an IProgress<T> interface which is equivalent to the interface defined by Microsoft.

Include WebRequestExtensions in all builds

Currently the WebRequestExtensions class is omitted from certain builds. To ensure the binary compatibility promise described in #69 holds, this class should be included in all releases.

Provide helpful error message when strong name keys are missing

A message like the follow would be useful when strong name keys have not been generated for a build.

Strong name key not found. Run "sn -k {filename}" to generate the key in "{absolute directory}".

If implemented in a separate .targets file, this feature could be used in multiple projects, and perhaps even distributed as its own NuGet package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.