FAkka.Quotation.Actor 0.3.0-alpha2

This is a prerelease version of FAkka.Quotation.Actor.
dotnet add package FAkka.Quotation.Actor --version 0.3.0-alpha2
                    
NuGet\Install-Package FAkka.Quotation.Actor -Version 0.3.0-alpha2
                    
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="FAkka.Quotation.Actor" Version="0.3.0-alpha2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FAkka.Quotation.Actor" Version="0.3.0-alpha2" />
                    
Directory.Packages.props
<PackageReference Include="FAkka.Quotation.Actor" />
                    
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 FAkka.Quotation.Actor --version 0.3.0-alpha2
                    
#r "nuget: FAkka.Quotation.Actor, 0.3.0-alpha2"
                    
#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 FAkka.Quotation.Actor@0.3.0-alpha2
                    
#: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=FAkka.Quotation.Actor&version=0.3.0-alpha2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FAkka.Quotation.Actor&version=0.3.0-alpha2&prerelease
                    
Install as a Cake Tool

FAkka.Quotation.Actor

供可信開發環境使用的小型 F# Quotation hot-load package。client 透過 Akka.Delivery 依序要求 host:

  1. 使用 public key 封裝 managed DLL,host 以本機 encrypted private-key file 解密並載入。
  2. 以 key 註冊或原子取代 ActorSystem -> 'Result Quotation。
  3. 依 key 執行並取得 typed result。

Runtime 固定使用 Akka/Akka.Remote 1.5.71,serializer identifier 為 198。此工具不提供 sandbox;只適用於 caller、host 與載入程式碼皆可信的開發環境。

最小流程:

let envelope =
    match AssemblyEnvelope.create (AssemblyEnvelope.defaults publicKeyPath) dllBytes with
    | Ok value -> value
    | Error failure -> failwith failure.Message
let client = QuotationClient.start actorSystem (QuotationClientOptions.create "fsstl-live")

QuotationClient.submit client.Client (QuotationRequest.loadAssembly "load-1" replyPath envelope)
QuotationClient.submit client.Client (QuotationRequest.register "register-1" replyPath "strategy" <@ fun system -> createStrategy system @>)
QuotationClient.submit client.Client (QuotationRequest.execute "execute-1" replyPath "strategy")

每個 request 都會得到一個 terminal QuotationReply;worker 只接受 ConsumerController.Delivery<QuotationRequest>,不支援 direct Tell 繞過可靠傳遞。

Collectible unary generations(0.2.0-alpha2)

需要在同一 process side-by-side 載入同 simple-name implementation 時,application 可使用獨立的 local API;generic package 不知道 consumer 的 message、行情或交易型別:

let options =
    CollectibleAssemblyLoadOptions.create
        "generation-20260816-a"
        absoluteDllPath
        [| "FSharp.Core"; "Akka"; "Host.Contracts" |]

let generation =
    CollectibleAssemblyLoading.loadFromFile options
    |> Result.defaultWith (fun failure -> failwith failure.Message)

let quotation =
    QuotationPayload.deserializeInContext generation.LoadContext pickledQuotation
    |> Result.defaultWith (fun failure -> failwith failure.Message)

let registration =
    UnaryQuotationRegistry.registerInContext
        generation.LoadContext
        generation.GenerationId
        "node-a"
        quotation
        UnaryQuotationRegistry.empty
    |> Result.defaultWith (fun failure -> failwith failure.Message)

UnaryQuotationRegistry.execute "node-a" input registration.Registry
|> Result.defaultWith (fun failure -> failwith failure.Message)

let retired =
    UnaryQuotationRegistry.removeGeneration generation.GenerationId registration.Registry

CollectibleAssemblyLoading.requestUnload generation

主 DLL 先以 bytes 驗證、SHA-256 後由 memory stream 載入,因此 loader 不會持續鎖住來源 DLL;plugin-private dependencies 仍由 AssemblyDependencyResolver 從來源目錄解析。shared assembly 必須由 caller 明列,且只能解析成 default-context 已載入的同 simple-name assembly,避免 host contract 出現兩份 CLR type identity。

requestUnload 只是提出 collectible unload;application 必須先停止該 generation 建立的 ActorSystem、actor、timer,排空 in-flight call,並釋放 Expr/delegate/Type/Assembly references。是否完成可讀 LoadContextWeakReference,不得把 Unload() return 當成同步完成。

Compiled unary quotation(0.3.0-alpha2)

UnaryQuotationRegistry exact依賴FAkka.FSharp.Quotations.Evaluator 2.2.0-alpha2。註冊時會在指定contextual-reflection scope內evaluate quotation,並把exact input cast+F# function call一次compile成Action<obj>;執行時只做key lookup、CLR input type gate與compiled delegate invoke。

Release package automation

Release build會先產生exact FAkka.Quotation.Actor.<PackageVersion>.nupkg,再由本專案的PostBuildEvent.ps1將該exact package推送至NuGet.org並複製到repo既有lib-packs.txt指定位置。API key只從NUGET_API_KEY_FILE或既有本機key檔讀取,不會輸出。

需要只build/pack、不發布時使用:

dotnet build .\FAkka.Quotation.Actor.fsproj -c Release -p:PublishQuotationActorPackage=false

Debug build不發布;push、key或configured library-packs失敗都會令Release build明確失敗。

unsupported quotation會拒絕registration且保留既有binding;不會fallback到LeafExpressionConverter。這個更新不改v1 ActorSystem -> 'Result registry,compiled boundary只適用collectible unary API。

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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
0.3.0-alpha2 74 9/4/2026
0.3.0-alpha1 92 8/16/2026