NolanHodge.Threader 1.0.0

dotnet add package NolanHodge.Threader --version 1.0.0
NuGet\Install-Package NolanHodge.Threader -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NolanHodge.Threader" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NolanHodge.Threader --version 1.0.0
#r "nuget: NolanHodge.Threader, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NolanHodge.Threader as a Cake Addin
#addin nuget:?package=NolanHodge.Threader&version=1.0.0

// Install NolanHodge.Threader as a Cake Tool
#tool nuget:?package=NolanHodge.Threader&version=1.0.0

Threader

Threader is a nuget package for running Tasks in parallel like they are System.Threading.Threads.

This package is optimized for long running operations. The UWP 10.0 framework does not allow the usage of Threads, but rather Tasks. Tasks are not treated like Threads and a user will not get a desired result using them in that manner.

Threader allows users to execute long and short running operations in the same manner as Threads.

Example

  using NolanHodge.Threader;
  
  // A Class that satisfies the IThreader interface.
  class Button : IThreader
  {
      Action<object> Draw;
      public ButtonData(Canvas canvas, Action<object> action)
      {
          Canvas = canvas;
          Label = label;
      }

      public string Name()
      {
          return Canvas.Name;
      }

      public void Action()
      {
          Draw(this);
      }
  }

  // The Application requiring long running operations.
  class Application
  {
    Threader T = new Threader(); 
    void Init()
    {
        foreach (string name in canvases)
        {
            T.Spawn(new Button(name, Diagnose))
        }
    }

    // Kill the Threaders pool.
    void OnClose()
    {
      T.KillAll();
    }

    // Use the IThreader object in parallel, handling stops.
    void Diagnose(Button b)
    {
        while (true)
        {
            if (T.Killed(b))
            {
                return;
            }

            OnMainThread(Draw(b));
        }
    }
}

Product Compatible and additional computed target framework versions.
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 482 11/17/2019