Search Results for

    Show / Hide Table of Contents

    Class ShardingProducerController.RequestNext<T>

    The ProducerController sends ShardingProducerController.RequestNext<T> to the producer when it is allowed to send one message via the SendNextTo or AskNextTo(MessageWithConfirmation<T>). It should wait for next ShardingProducerController.RequestNext<T> before sending another message.

    EntitiesWithDemand contains information about which entities that have demand. It is allowed to send to a new string that is not included in the EntitiesWithDemand. If sending to an entity that doesn't have demand the message will be buffered, and that can be seen in the BufferedForEntitiesWithoutDemand.

    This support for buffering means that it is even allowed to send several messages in response to one ShardingProducerController.RequestNext<T>, but it's recommended to only send one message and wait for next ShardingProducerController.RequestNext<T> before sending more messages.

    Inheritance
    object
    ShardingProducerController.RequestNext<T>
    Implements
    IEquatable<ShardingProducerController.RequestNext<T>>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Cluster.Sharding.Delivery
    Assembly: Akka.Cluster.Sharding.dll
    Syntax
    public sealed record ShardingProducerController.RequestNext<T> : IEquatable<ShardingProducerController.RequestNext<T>>
    Type Parameters
    Name Description
    T

    The type of message that can be handled by the consumer actors.

    Constructors

    | Edit this page View Source

    RequestNext(IActorRef, IActorRef, ImmutableHashSet<string>, ImmutableDictionary<string, int>)

    The ProducerController sends ShardingProducerController.RequestNext<T> to the producer when it is allowed to send one message via the SendNextTo or AskNextTo(MessageWithConfirmation<T>). It should wait for next ShardingProducerController.RequestNext<T> before sending another message.

    EntitiesWithDemand contains information about which entities that have demand. It is allowed to send to a new string that is not included in the EntitiesWithDemand. If sending to an entity that doesn't have demand the message will be buffered, and that can be seen in the BufferedForEntitiesWithoutDemand.

    This support for buffering means that it is even allowed to send several messages in response to one ShardingProducerController.RequestNext<T>, but it's recommended to only send one message and wait for next ShardingProducerController.RequestNext<T> before sending more messages.

    Declaration
    public RequestNext(IActorRef SendNextTo, IActorRef AskNextToRef, ImmutableHashSet<string> EntitiesWithDemand, ImmutableDictionary<string, int> BufferedForEntitiesWithoutDemand)
    Parameters
    Type Name Description
    IActorRef SendNextTo
    IActorRef AskNextToRef
    ImmutableHashSet<string> EntitiesWithDemand
    ImmutableDictionary<string, int> BufferedForEntitiesWithoutDemand

    Properties

    | Edit this page View Source

    AskNextToRef

    Declaration
    public IActorRef AskNextToRef { get; init; }
    Property Value
    Type Description
    IActorRef
    | Edit this page View Source

    BufferedForEntitiesWithoutDemand

    Declaration
    public ImmutableDictionary<string, int> BufferedForEntitiesWithoutDemand { get; init; }
    Property Value
    Type Description
    ImmutableDictionary<string, int>
    | Edit this page View Source

    EntitiesWithDemand

    Declaration
    public ImmutableHashSet<string> EntitiesWithDemand { get; init; }
    Property Value
    Type Description
    ImmutableHashSet<string>
    | Edit this page View Source

    SendNextTo

    Declaration
    public IActorRef SendNextTo { get; init; }
    Property Value
    Type Description
    IActorRef

    Methods

    | Edit this page View Source

    AskNextTo(MessageWithConfirmation<T>)

    Delivers a ShardingProducerController.MessageWithConfirmation<T> to the SendNextTo actor.

    The ReplyTo actor will receive a confirmation message containing the confirmed SeqNo (long) for this message once it's been successfully processed by the consumer.

    Declaration
    public void AskNextTo(ShardingProducerController.MessageWithConfirmation<T> msgWithConfirmation)
    Parameters
    Type Name Description
    ShardingProducerController.MessageWithConfirmation<T> msgWithConfirmation

    The message and the replyTo address.

    Remarks

    This method name is a bit misleading - we're actually performing a Tell, not an Ask.

    The other overload does perform an Ask and uses the temporary Ask actor as the replyTo address.

    | Edit this page View Source

    AskNextTo(string, T, CancellationToken)

    Uses an Ask{T} to send the message to the SendNextTo actor and returns an Ack(long).

    Declaration
    public Task<long> AskNextTo(string entityId, T msg, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string entityId

    The id of the entity we're messaging.

    T msg

    The message to send with confirmation back to the temporary Ask actor.

    CancellationToken cancellationToken

    Optional - a CancellationToken.

    Note: this token only cancels the receipt of the Ack (long) - it does not stop the message from being delivered.
    
    Returns
    Type Description
    Task<long>

    A task that will complete once the message has been successfully persisted by the ProducerController.

    Implements

    IEquatable<T>

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET