Header menu logo FCQRS

ActorWiring Type

Low-level wiring over an IActor: register the saga-starter, aggregates and actors, and send commands. Most members are plain static helpers (you call ActorWiring.Foo(actor, …)); a couple are genuine extension methods. For app composition, prefer the host-builder API (AddFcqrs/AddAggregate/AddSaga).

Static members

Static member Description

ActorWiring.CreateCommand(actor, entityFactory, cid, aggregateId, command, filter)

Full Usage: ActorWiring.CreateCommand(actor, entityFactory, cid, aggregateId, command, filter)

Parameters:
Returns: Async<Event<'TEvent>>

C#-friendly CreateCommandSubscription that returns FSharpAsync (for use with Handler delegate)

actor : IActor
entityFactory : AggregateFactory
cid : CID
aggregateId : AggregateId
command : 'TCommand
filter : Func<'TEvent, bool>
Returns: Async<Event<'TEvent>>

ActorWiring.InitActor(actor, initialState, entityName, handleCommand, applyEvent, snapshotPolicy)

Full Usage: ActorWiring.InitActor(actor, initialState, entityName, handleCommand, applyEvent, snapshotPolicy)

Parameters:
Returns: EntityFac<obj>

InitActor with an explicit per-aggregate snapshot policy.

actor : IActor
initialState : 'TState
entityName : string
handleCommand : Func<Command<'TCommand>, 'TState, EventAction<'TEvent>>
applyEvent : Func<Event<'TEvent>, 'TState, 'TState>
snapshotPolicy : SnapshotPolicy
Returns: EntityFac<obj>

ActorWiring.InitActor(actor, initialState, entityName, handleCommand, applyEvent)

Full Usage: ActorWiring.InitActor(actor, initialState, entityName, handleCommand, applyEvent)

Parameters:
Returns: EntityFac<obj>

C#-friendly InitializeActor that accepts Func delegates instead of F# functions

actor : IActor
initialState : 'TState
entityName : string
handleCommand : Func<Command<'TCommand>, 'TState, EventAction<'TEvent>>
applyEvent : Func<Event<'TEvent>, 'TState, 'TState>
Returns: EntityFac<obj>

ActorWiring.InitAggregate(actor, initialState, entityName, handleCommand, applyEvent, snapshotPolicy)

Full Usage: ActorWiring.InitAggregate(actor, initialState, entityName, handleCommand, applyEvent, snapshotPolicy)

Parameters:
Returns: AggregateRefs<'TCommand, 'TEvent>

InitAggregate with an explicit per-aggregate snapshot policy.

actor : IActor
initialState : 'TState
entityName : string
handleCommand : Func<Command<'TCommand>, 'TState, EventAction<'TEvent>>
applyEvent : Func<Event<'TEvent>, 'TState, 'TState>
snapshotPolicy : SnapshotPolicy
Returns: AggregateRefs<'TCommand, 'TEvent>

ActorWiring.InitAggregate(actor, initialState, entityName, handleCommand, applyEvent)

Full Usage: ActorWiring.InitAggregate(actor, initialState, entityName, handleCommand, applyEvent)

Parameters:
Returns: AggregateRefs<'TCommand, 'TEvent>

One-call aggregate wiring: registers the aggregate (sharding region) and returns its Factory + Handler. Collapses the Init/Factory/Handler trio an aggregate would otherwise hand-roll. Call it for EVERY aggregate you want live — registration is the act of calling this, not a side effect.

actor : IActor
initialState : 'TState
entityName : string
handleCommand : Func<Command<'TCommand>, 'TState, EventAction<'TEvent>>
applyEvent : Func<Event<'TEvent>, 'TState, 'TState>
Returns: AggregateRefs<'TCommand, 'TEvent>

ActorWiring.InitSagaStarter(actor, eventHandler)

Full Usage: ActorWiring.InitSagaStarter(actor, eventHandler)

Parameters:

C#-friendly InitializeSagaStarter that accepts Func returning IList of SagaDefinition

actor : IActor
eventHandler : Func<obj, IList<SagaDefinition>>

ActorWiring.InitSagaStarterEmpty(actor)

Full Usage: ActorWiring.InitSagaStarterEmpty(actor)

Parameters:

Static helper for C# where extension may not resolve

actor : IActor

ActorWiring.InitSagaStarterSimple(actor, eventHandler)

Full Usage: ActorWiring.InitSagaStarterSimple(actor, eventHandler)

Parameters:

C#-friendly simplified InitializeSagaStarter where you just return factories

actor : IActor
eventHandler : Func<obj, IList<AggregateFactory>>

ActorWiring.InitializeSagaStarterEmpty(actor)

Full Usage: ActorWiring.InitializeSagaStarterEmpty(actor)

Parameters:

Initialize saga starter with no sagas (for simple scenarios)

actor : IActor

ActorWiring.SendCommandAsync(actor, entityFactory, cid, aggregateId, command, filter)

Full Usage: ActorWiring.SendCommandAsync(actor, entityFactory, cid, aggregateId, command, filter)

Parameters:
Returns: Task<Event<'TEvent>>

Send a command and wait for the event (C# friendly)

actor : IActor
entityFactory : AggregateFactory
cid : CID
aggregateId : AggregateId
command : 'TCommand
filter : Func<'TEvent, bool>
Returns: Task<Event<'TEvent>>

Type something to start searching.