![]() |
VOOZH | about |
dotnet add package SnapshotRestore.Registry --version 1.0.2
NuGet\Install-Package SnapshotRestore.Registry -Version 1.0.2
<PackageReference Include="SnapshotRestore.Registry" Version="1.0.2" />
<PackageVersion Include="SnapshotRestore.Registry" Version="1.0.2" />Directory.Packages.props
<PackageReference Include="SnapshotRestore.Registry" />Project file
paket add SnapshotRestore.Registry --version 1.0.2
#r "nuget: SnapshotRestore.Registry, 1.0.2"
#:package SnapshotRestore.Registry@1.0.2
#addin nuget:?package=SnapshotRestore.Registry&version=1.0.2Install as a Cake Addin
#tool nuget:?package=SnapshotRestore.Registry&version=1.0.2Install as a Cake Tool
The primary aim of this project is to develop a new API to register and retrieve tasks of type ValueTask.
The class uses a ConcurrentStack and a ConcurrentQueue to store the registered hooks, which are Func<ValueTask> objects.
The RegisterBeforeSnapshot and RegisterAfterRestore methods allow users to register their own hooks, while the InvokeBeforeSnapshotCallbacks and InvokeAfterRestoreCallbacks methods allow the caller to invoke these snapstart hooks.
This implementation is used for Snapstart, a feature that allows for quick restoration of application state.
/// <summary>
/// Example class to demonstrate usage of SnapshotRestore.Registry library
/// </summary>
public class SnapstartExample
{
private Guid _myExecutionEnvironmentGuid;
public SnapstartExample()
{
// This GUID is set for non-restore use-cases such as testing or if SnapStart is turned off
_myExecutionEnvironmentGuid = new Guid();
// Register the method which will run after each restore. You may need to update Amazon.Lambda.Core to see this
Amazon.Lambda.Core.SnapshotRestore.RegisterAfterRestore(MyAfterRestore);
}
private ValueTask MyAfterRestore()
{
// After we restore this snapshot to a new execution environment, update the GUID
_myExecutionEnvironmentGuid = new Guid();
return ValueTask.CompletedTask;
}
public string Handler()
{
return $"Hello World! My Execution Environment GUID is {_myExecutionEnvironmentGuid}";
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on SnapshotRestore.Registry:
| Package | Downloads |
|---|---|
|
Amazon.Lambda.RuntimeSupport
Provides a bootstrap and Lambda Runtime API Client to help you to develop custom .NET Core Lambda Runtimes. |
This package is not used by any popular GitHub repositories.