Redigera

Dela via


IGrainExtensionBinder.GetOrSetExtension<TExtension,TExtensionInterface> Method

Definition

Binds an extension to an addressable object, if not already done.

public (TExtension, TExtensionInterface) GetOrSetExtension<TExtension,TExtensionInterface> (Func<TExtension> newExtensionFunc) where TExtension : class, TExtensionInterface where TExtensionInterface : class, Orleans.Runtime.IGrainExtension;
abstract member GetOrSetExtension : Func<#'ExtensionInterface> -> ValueTuple<#'ExtensionInterface, 'ExtensionInterface (requires 'ExtensionInterface : null and 'ExtensionInterface :> Orleans.Runtime.IGrainExtension)> (requires 'ExtensionInterface : null and 'ExtensionInterface :> Orleans.Runtime.IGrainExtension)
Public Function GetOrSetExtension(Of TExtension As {Class, TExtensionInterface}, TExtensionInterface As {Class, TExtensionInterface}) (newExtensionFunc As Func(Of TExtension)) As ValueTuple(Of TExtension, TExtensionInterface)

Type Parameters

TExtension

The type of the extension (e.g. StreamConsumerExtension).

TExtensionInterface

The public interface type of the implementation.

Parameters

newExtensionFunc
Func<TExtension>

A factory function that constructs a new extension object.

Returns

ValueTuple<TExtension,TExtensionInterface>

A tuple, containing first the extension and second an addressable reference to the extension's interface.

Applies to