Zomp.SyncMethodGenerator 0.1.33-alpha

This is a prerelease version of Zomp.SyncMethodGenerator.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Zomp.SyncMethodGenerator --version 0.1.33-alpha
NuGet\Install-Package Zomp.SyncMethodGenerator -Version 0.1.33-alpha
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="Zomp.SyncMethodGenerator" Version="0.1.33-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Zomp.SyncMethodGenerator --version 0.1.33-alpha
#r "nuget: Zomp.SyncMethodGenerator, 0.1.33-alpha"
#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 Zomp.SyncMethodGenerator as a Cake Addin
#addin nuget:?package=Zomp.SyncMethodGenerator&version=0.1.33-alpha&prerelease

// Install Zomp.SyncMethodGenerator as a Cake Tool
#tool nuget:?package=Zomp.SyncMethodGenerator&version=0.1.33-alpha&prerelease

Sync Method Generator

Build Support .NET Standard 2.0 Nuget

This .NET source generator produces a sync method from an async one.

Use cases

  • A library which exposes both sync and async version of a method
  • An application has to process two kinds of data in the same way:
    • Large data from I/O which cannot be stored in memory before processing: Original async method
    • Small sample of data in memory, usually a sample of the larger data: Generated sync method

How it works

Add CreateSyncVersionAttribute to your async method in your partial class

[Zomp.SyncMethodGenerator.CreateSyncVersion]
static async Task WriteAsync(ReadOnlyMemory<byte> buffer, Stream stream, 
CancellationToken ct)
    => await stream.WriteAsync(buffer, ct).ConfigureAwait(true);

And it will generate a sync version of the method:

static void Write(ReadOnlySpan<byte> buffer, Stream stream)
    => stream.Write(buffer);

A list of changes applied to the new synchronized method:

Installation

To add the library use:

dotnet add package Zomp.SyncMethodGenerator
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • 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.4.1 182 5/21/2024
1.3.44 161 5/14/2024
1.3.43 143 4/26/2024
1.3.40 451 4/11/2024
1.3.39 193 4/9/2024
1.3.38 327 3/23/2024
1.3.36 153 3/20/2024
1.3.35 64 3/19/2024
1.3.33 116 3/18/2024
1.3.28 117 3/18/2024
1.3.27 136 3/17/2024
1.3.24 278 3/12/2024
1.3.23 176 3/12/2024
1.3.21 141 3/11/2024
1.3.20 166 3/11/2024
1.3.18 134 3/10/2024
1.3.17 223 2/26/2024
1.3.16 246 2/26/2024
1.3.13 163 2/25/2024
1.3.8-beta 145 2/12/2024
1.3.6 240 1/26/2024
1.3.5 150 1/21/2024
1.3.1 237 1/17/2024
1.2.24 161 1/14/2024
1.2.18 131 1/5/2024
1.2.16 169 1/5/2024
1.2.13 135 1/4/2024
1.2.12 132 1/4/2024
1.2.8 122 1/3/2024
1.2.3 368 11/20/2023
1.2.1 147 11/13/2023
1.1.2 717 8/8/2023
1.0.14 226 8/4/2023
1.0.12 27,062 8/3/2023
1.0.11 208 8/2/2023
1.0.5 129 7/31/2023
1.0.3 121 7/29/2023
1.0.2 139 7/29/2023
1.0.1 189 7/27/2023
0.1.39-alpha 472 1/25/2023
0.1.38-alpha 200 1/19/2023
0.1.37-alpha 188 1/19/2023
0.1.34-alpha 180 1/18/2023
0.1.33-alpha 164 1/15/2023
0.1.30-alpha 223 11/21/2022
0.1.22-alpha 184 11/19/2022
0.1.21-alpha 177 11/19/2022
0.1.19-alpha 154 11/19/2022
0.1.18-alpha 192 11/18/2022
0.1.17-alpha 259 11/14/2022
0.1.13-alpha 159 11/13/2022
0.1.12-alpha 209 10/31/2022
0.1.10-alpha 161 10/28/2022
0.1.9-alpha 203 10/27/2022
0.1.8-alpha 229 10/27/2022
0.1.5-alpha 186 10/27/2022
0.1.4-alpha 211 10/27/2022
0.1.3-alpha 226 10/26/2022
0.1.2-alpha 228 10/25/2022
0.1.1-alpha 247 10/25/2022