Show / Hide Table of Contents

    Class MessageCorrelationManagerBase

    Inheritance
    System.Object
    MessageCorrelationManagerBase
    PeerMessageCorrelationManager
    RpcMessageCorrelationManager
    Implements
    IMessageCorrelationManager
    System.IDisposable
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Catalyst.Core.Lib.IO.Messaging.Correlation
    Assembly: Catalyst.Core.Lib.dll
    Syntax
    public abstract class MessageCorrelationManagerBase : IMessageCorrelationManager, IDisposable

    Constructors

    | Improve this Doc View Source

    MessageCorrelationManagerBase(IMemoryCache, ILogger, IChangeTokenProvider)

    Declaration
    protected MessageCorrelationManagerBase(IMemoryCache cache, ILogger logger, IChangeTokenProvider changeTokenProvider)
    Parameters
    Type Name Description
    IMemoryCache cache
    ILogger logger
    IChangeTokenProvider changeTokenProvider

    Fields

    | Improve this Doc View Source

    Logger

    Declaration
    protected readonly ILogger Logger
    Field Value
    Type Description
    ILogger
    | Improve this Doc View Source

    PendingRequests

    Declaration
    protected readonly IMemoryCache PendingRequests
    Field Value
    Type Description
    IMemoryCache

    Methods

    | Improve this Doc View Source

    AddPendingRequest(ICorrelatableMessage<ProtocolMessage>)

    Stores a CorrelatableMessage in the cache so we can correlate incoming messages.

    Declaration
    public virtual void AddPendingRequest(ICorrelatableMessage<ProtocolMessage> correlatableMessage)
    Parameters
    Type Name Description
    ICorrelatableMessage<ProtocolMessage> correlatableMessage
    | Improve this Doc View Source

    Dispose()

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    | Improve this Doc View Source

    EvictionCallback(Object, Object, EvictionReason, Object)

    A callback method that is called upon eviction of a message, for basic protocols such the RPC, it doesn't do anything

    Declaration
    protected abstract void EvictionCallback(object key, object value, EvictionReason reason, object state)
    Parameters
    Type Name Description
    System.Object key
    System.Object value
    EvictionReason reason
    System.Object state
    | Improve this Doc View Source

    TryMatchResponse(ProtocolMessage)

    Takes a generic request type of IMessage, and generic response type of IMessage and the message and look them up in the cache. Return what's found or emit an-uncorrectable event

    Declaration
    public virtual bool TryMatchResponse(ProtocolMessage response)
    Parameters
    Type Name Description
    ProtocolMessage response
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ValidateResponseType(ProtocolMessage, ICorrelatableMessage<ProtocolMessage>)

    Declaration
    protected static void ValidateResponseType(ProtocolMessage response, ICorrelatableMessage<ProtocolMessage> responseFromCache)
    Parameters
    Type Name Description
    ProtocolMessage response
    ICorrelatableMessage<ProtocolMessage> responseFromCache
    Remarks

    Do we want to create reputation events if the response type doesn't match? https://github.com/catalyst-network/Catalyst.Node/issues/674 This might be OK if we can be sure that the person responding is actually the one with the PeerId mentioned in the response. Is the correlationId enough to ensure that?

    Implements

    IMessageCorrelationManager
    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Copyright © 2019 Catalyst Network