FSharp Module
Idiomatic-F# functional facade for FCQRS.
Gives F# consumers the same one-call ergonomics the C# host-builder
(HostExtensions.fs) gives C#, but with F# idioms: records-of-functions for the
definitions, typed handles for the results, an explicit wiring pipeline, and
plain helpers for saga side effects. It is a *pure addition* — it wraps only the
existing primitives (IActor.InitializeActor / SagaBuilder.initSimple / Query.init
/ InitializeSagaStarter / CreateCommandSubscription / Actor.api) and changes
nothing in the C# interop layer or the core.
open FCQRS.FSharp
let api = Fcqrs.actor config loggerFactory (Some (Fcqrs.connect DBType.Sqlite conn)) "Cluster"
let documents = Fcqrs.aggregate api { Name="Document"; Initial=...; Decide=...; Fold=... }
let users = Fcqrs.aggregate api { Name="User"; ... }
let quota = Fcqrs.saga api (quotaDef documents.Factory users.Factory)
Fcqrs.wireSagaStarters api [ quota ]
let subs = Fcqrs.projection api (Projection.single 0 updateReadModel)
// (Projection.multi when you must control which notifications publish)
// send a command and await the resulting event (read-your-writes):
let! ev = documents.Send (Fcqrs.newCid()) (Fcqrs.aggregateId id) cmd (fun e -> ...)
Types and nested modules
| Type/Module | Description |
Functions and values
| Function or value | Description |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
toActor actorRef command
Parameters:
IActorRef<obj>
command : obj
Returns: ExecuteCommand
|
|
Full Usage:
toActorAfter actorRef delayMs taskName command
Parameters:
IActorRef<obj>
delayMs : int64
taskName : string
command : obj
Returns: ExecuteCommand
|
|
Full Usage:
toAggregate factory id command
Parameters:
AggregateFactory
id : string
command : obj
Returns: ExecuteCommand
|
|
Full Usage:
toAggregateAfter factory id delayMs taskName command
Parameters:
AggregateFactory
id : string
delayMs : int64
taskName : string
command : obj
Returns: ExecuteCommand
|
|
Full Usage:
toOriginator factory command
Parameters:
AggregateFactory
command : obj
Returns: ExecuteCommand
|
|
Full Usage:
toOriginatorAfter factory delayMs taskName command
Parameters:
AggregateFactory
delayMs : int64
taskName : string
command : obj
Returns: ExecuteCommand
|
|
|
|
Full Usage:
toSelfAfter delayMs taskName command
Parameters:
int64
taskName : string
command : obj
Returns: ExecuteCommand
|
|
|
|
FCQRS