Skip to content

CoreHostingExtensions Methods

Extensions for ISiloBuilder instances.

AddActivityPropagation(ISiloBuilder)

staticextension
View source
public static ISiloBuilder AddActivityPropagation(this ISiloBuilder builder)
Add System.Diagnostics.Activity.Current propagation through grain calls. Note: according to System.Diagnostics.ActivitySource.StartActivity activity will be created only when any listener for activity exists System.Diagnostics.ActivitySource.HasListeners and System.Diagnostics.ActivityListener.Sample returns System.Diagnostics.ActivitySamplingResult.PropagationData.

Parameters

builderISiloBuilder
The builder.

Returns

The builder.

AddDistributedGrainDirectory(ISiloBuilder, string?)

staticextension
View source
public static ISiloBuilder AddDistributedGrainDirectory(this ISiloBuilder siloBuilder, string? name = null)
Configures the distributed grain directory.

Parameters

siloBuilderISiloBuilder
The silo builder to register the directory implementation with.
namestring?
The name to register the directory under, or null to register it as the default. Multiple names share one directory instance.

Returns

The provided silo builder.

UseDevelopmentClustering(ISiloBuilder, IPEndPoint?)

staticextension
View source
public static ISiloBuilder UseDevelopmentClustering(this ISiloBuilder builder, IPEndPoint? primarySiloEndpoint)
Configures the silo to use development-only clustering.

Parameters

builderISiloBuilder
primarySiloEndpointIPEndPoint?
The endpoint of the primary silo, or null to use this silo as the primary.

Returns

The silo builder.

UseLegacyGrainDirectory(ISiloBuilder)

staticextension
View source
public static ISiloBuilder UseLegacyGrainDirectory(this ISiloBuilder siloBuilder)
Selects the legacy grain directory as the default for grain types without an explicit directory selection.

Parameters

siloBuilderISiloBuilder
The silo builder.

Returns

The provided silo builder.

UseLocalhostClustering(ISiloBuilder, int, int, IPEndPoint?, string, string)

staticextension
View source
public static ISiloBuilder UseLocalhostClustering(this ISiloBuilder builder, int siloPort = 11111, int gatewayPort = 30000, IPEndPoint? primarySiloEndpoint = null, string serviceId = "dev", string clusterId = "dev")
Configures the silo to use development-only clustering and listen on localhost.

Parameters

builderISiloBuilder
The silo builder.
siloPortint
The silo port.
gatewayPortint
The gateway port.
primarySiloEndpointIPEndPoint?
The endpoint of the primary silo, or null to use this silo as the primary.
serviceIdstring
The service id.
clusterIdstring
The cluster id.

Returns

The silo builder.