Effect.Concurrency
0.1.0-alpha.2
This is a prerelease version of Effect.Concurrency.
dotnet add package Effect.Concurrency --version 0.1.0-alpha.2
NuGet\Install-Package Effect.Concurrency -Version 0.1.0-alpha.2
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="Effect.Concurrency" Version="0.1.0-alpha.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Effect.Concurrency" Version="0.1.0-alpha.2" />
<PackageReference Include="Effect.Concurrency" />
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 Effect.Concurrency --version 0.1.0-alpha.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Effect.Concurrency, 0.1.0-alpha.2"
#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 Effect.Concurrency@0.1.0-alpha.2
#: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=Effect.Concurrency&version=0.1.0-alpha.2&prerelease
#tool nuget:?package=Effect.Concurrency&version=0.1.0-alpha.2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Effect.Concurrency
Structured concurrency primitives for Effect.
Fibers, concurrent data structures, streams, and combinators for parallel and racing effects.
Install
dotnet add package Effect.Concurrency --prerelease
Requires the Effect package.
Fibers
open Eff
let program =
effect {
let! fiber = EffectConcurrency.fork () longRunningEffect
// do other work...
let! result = Fiber.join fiber
return result
}
// Interrupt a fiber
do! Fiber.interrupt fiber
// Race multiple effects
let! fastest = EffectConcurrency.raceAll [ server1; server2 ]
// Timeout
let! result = myEffect |> EffectConcurrency.timeout (TimeSpan.FromSeconds 5.0)
// Ok (Some value) or Ok None
Ref — thread-safe mutable state
let program =
effect {
let! counter = Ref.make 0
let inc = effect { for _ in 1..1000 do do! Ref.update ((+) 1) counter }
let! _ = EffectConcurrency.zipPar inc inc
return! Ref.get counter // Ok 2000
}
Deferred — one-shot promise
let program =
effect {
let! promise = Deferred.make<unit, AppError, string> ()
let! fiber = EffectConcurrency.fork () (effect {
do! Effect.sleep 100
let! _ = Deferred.succeed "done" promise
return ()
})
let! value = Deferred.await promise
return value
}
Queue — bounded async channel
Backed by System.Threading.Channels.Channel<T>.
let program =
effect {
let! q = Queue.bounded<unit, AppError, int> 5
let producer = effect { for i in 1..10 do do! Queue.put i q }
let consumer = effect { for _ in 1..10 do let! _ = Queue.take q in () }
let! _ = EffectConcurrency.zipPar producer consumer
return ()
}
Stream — lazy async sequences
Push-based streams with backpressure, typed errors, and cancellation.
let result =
Stream.range 1 100
|> Stream.filter (fun x -> x % 2 = 0)
|> Stream.map (fun x -> x * x)
|> Stream.take 10
|> Stream.runCollect
|> Effect.run ()
// Merge concurrent streams
let merged = Stream.merge stream1 stream2
// Pipe to/from queues
do! myStream |> Stream.toQueue queue
let fromQ = Stream.fromQueue queue |> Stream.take 100
TestClock — deterministic time
Test time-dependent effects without real delays.
let clock = TestClock()
let program = effect {
do! clock.Sleep 5000
return "done"
}
let resultTask = Effect.run () program
clock.AdvanceByMillis 5000 // resolves instantly
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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.
-
net9.0
- Effect (>= 0.1.0-alpha.2)
- FSharp.Core (>= 10.1.201)
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.1.0-alpha.2 | 81 | 4/6/2026 |
| 0.1.0-alpha.1 | 62 | 4/6/2026 |