Zomp.SyncMethodGenerator 0.1.38-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.38-alpha
                    
NuGet\Install-Package Zomp.SyncMethodGenerator -Version 0.1.38-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.38-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zomp.SyncMethodGenerator" Version="0.1.38-alpha" />
                    
Directory.Packages.props
<PackageReference Include="Zomp.SyncMethodGenerator" />
                    
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 Zomp.SyncMethodGenerator --version 0.1.38-alpha
                    
#r "nuget: Zomp.SyncMethodGenerator, 0.1.38-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.
#:package Zomp.SyncMethodGenerator@0.1.38-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Zomp.SyncMethodGenerator&version=0.1.38-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Zomp.SyncMethodGenerator&version=0.1.38-alpha&prerelease
                    
Install as a Cake Tool

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 (3)

Showing the top 3 popular GitHub repositories that depend on Zomp.SyncMethodGenerator:

Repository Stars
FluentValidation/FluentValidation
A popular .NET validation library for building strongly-typed validation rules.
Zeugma440/atldotnet
Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
AvionBlock/VoiceCraft
VoiceCraft software to implement proximity VC for Minecraft Bedrock Edition
Version Downloads Last Updated
1.6.3 110 7/17/2025
1.6.2 329 7/8/2025
1.6.1 134 7/8/2025
1.5.3 119 7/4/2025
1.5.1 225 6/29/2025
1.4.38 142 6/23/2025
1.4.37 211 6/23/2025
1.4.35 144 6/17/2025
1.4.32 242 6/17/2025
1.4.30 510 6/14/2025
1.4.29 509 6/12/2025
1.4.28 301 6/11/2025
1.4.27 282 6/11/2025
1.4.26 502 6/11/2025
1.4.25 508 6/10/2025
1.4.20 500 3/9/2025
1.4.18 189 2/24/2025
1.4.15 595 11/17/2024
1.4.14 1,799 8/7/2024
1.4.13 921 7/21/2024
1.4.11 729 7/15/2024
1.4.10 658 7/13/2024
1.4.8 314 7/8/2024
1.4.3 264 6/27/2024
1.4.1 295 5/21/2024
1.3.44 228 5/14/2024
1.3.43 308 4/26/2024
1.3.40 525 4/11/2024
1.3.39 265 4/9/2024
1.3.38 397 3/23/2024
1.3.36 230 3/20/2024
1.3.35 124 3/19/2024
1.3.33 185 3/18/2024
1.3.28 196 3/18/2024
1.3.27 211 3/17/2024
1.3.24 455 3/12/2024
1.3.23 252 3/12/2024
1.3.21 221 3/11/2024
1.3.20 252 3/11/2024
1.3.18 224 3/10/2024
1.3.17 292 2/26/2024
1.3.16 337 2/26/2024
1.3.13 245 2/25/2024
1.3.8-beta 1,036 2/12/2024
1.3.6 307 1/26/2024
1.3.5 228 1/21/2024
1.3.1 324 1/17/2024
1.2.24 236 1/14/2024
1.2.18 211 1/5/2024
1.2.16 230 1/5/2024
1.2.13 208 1/4/2024
1.2.12 205 1/4/2024
1.2.8 208 1/3/2024
1.2.3 446 11/20/2023
1.2.1 219 11/13/2023
1.1.2 2,913 8/8/2023
1.0.14 298 8/4/2023
1.0.12 32,284 8/3/2023
1.0.11 268 8/2/2023
1.0.5 192 7/31/2023
1.0.3 178 7/29/2023
1.0.2 195 7/29/2023
1.0.1 345 7/27/2023
0.1.39-alpha 558 1/25/2023
0.1.38-alpha 276 1/19/2023
0.1.37-alpha 274 1/19/2023
0.1.34-alpha 269 1/18/2023
0.1.33-alpha 244 1/15/2023
0.1.30-alpha 308 11/21/2022
0.1.22-alpha 258 11/19/2022
0.1.21-alpha 259 11/19/2022
0.1.19-alpha 233 11/19/2022
0.1.18-alpha 269 11/18/2022
0.1.17-alpha 338 11/14/2022
0.1.13-alpha 244 11/13/2022
0.1.12-alpha 286 10/31/2022
0.1.10-alpha 246 10/28/2022
0.1.9-alpha 285 10/27/2022
0.1.8-alpha 307 10/27/2022
0.1.5-alpha 267 10/27/2022
0.1.4-alpha 286 10/27/2022
0.1.3-alpha 315 10/26/2022
0.1.2-alpha 308 10/25/2022
0.1.1-alpha 333 10/25/2022