F# Examples
F# examples use the same NuGet packages as the C# examples.
Service SDKs
Same packages as C# — all Virtufin .NET client libraries are compatible with F#.
Key Patterns
open Virtufin.WebSocketManager.Client
use client = new WebSocketManagerClient(host)
let! result = client.ConnectAsync(ConnectRequest(
Url = "wss://stream.binance.com:9443/ws/btcusdt@depth@100ms",
AutoReconnect = true,
CorrelationMode = CorrelationMode.Raw
)) |> Async.AwaitTask
printfn $"Connected: id={result.Id}"
Differences from C#:
- Uses
Async.AwaitTaskto bridge .NET Tasks to F# async workflows - Uses
Option.ofObjfor nullable environment variable handling - Pattern matching with
match ... withinstead ofswitch