Class MessageCorrelationManagerBase
Inheritance
System.Object
MessageCorrelationManagerBase
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 SourceMessageCorrelationManagerBase(IMemoryCache, ILogger, IChangeTokenProvider)
Declaration
protected MessageCorrelationManagerBase(IMemoryCache cache, ILogger logger, IChangeTokenProvider changeTokenProvider)
Parameters
Type | Name | Description |
---|---|---|
IMemory |
cache | |
ILogger | logger | |
IChange |
changeTokenProvider |
Fields
| Improve this Doc View SourceLogger
Declaration
protected readonly ILogger Logger
Field Value
Type | Description |
---|---|
ILogger |
PendingRequests
Declaration
protected readonly IMemoryCache PendingRequests
Field Value
Type | Description |
---|---|
IMemory |
Methods
| Improve this Doc View SourceAddPendingRequest(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 |
---|---|---|
ICorrelatable |
correlatableMessage |
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System. |
disposing |
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. |
key | |
System. |
value | |
Eviction |
reason | |
System. |
state |
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 |
---|---|---|
Protocol |
response |
Returns
Type | Description |
---|---|
System. |
ValidateResponseType(ProtocolMessage, ICorrelatableMessage<ProtocolMessage>)
Declaration
protected static void ValidateResponseType(ProtocolMessage response, ICorrelatableMessage<ProtocolMessage> responseFromCache)
Parameters
Type | Name | Description |
---|---|---|
Protocol |
response | |
ICorrelatable |
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
System.IDisposable