Green.CT.Asyncify.Net 1.0.0

dotnet add package Green.CT.Asyncify.Net --version 1.0.0
                    
NuGet\Install-Package Green.CT.Asyncify.Net -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="Green.CT.Asyncify.Net" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Green.CT.Asyncify.Net" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Green.CT.Asyncify.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Green.CT.Asyncify.Net --version 1.0.0
                    
#r "nuget: Green.CT.Asyncify.Net, 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.
#addin nuget:?package=Green.CT.Asyncify.Net&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Green.CT.Asyncify.Net&version=1.0.0
                    
Install as a Cake Tool

Asyncify

Some times we have a api that must handle heavy request; for example, an api that adds a list of items to database and it's consumes bunch of times!

Asyncify will handle this problem. It will run your request in new background thread and end-user will not wait for response.

Installation

Asyncify is installed from NuGet.

dotnet add package Asyncify.Net

Documentation

At first, use AsyncRequest attribute on the request which you need to run it as async

[AsyncRequest(nameof(Index))]
public IActionResult Index()

and then add AsyncController attribute on controller that request is included in it.

[AsyncController(typeof(ProductsController))]
public class ProductsController : Controller

Finally, register the middleware to handle your async requests:

app.UseAsyncRequest();

For tracking response of your request, Asyncify will add an api with /async that accept trackId as a query and return response in this template:

public class AsyncRequestDto(
    Guid trackId,
    AsyncRequestStatus status,
    object? result)
{
    public Guid TrackId { get; } = trackId;
    public AsyncRequestStatus Status { get; } = status;
    public object? Result { get; } = result;
}

Every async request can some status that will showed in Status property, and the your Dto will filled in Result propery.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 157 4/1/2024