Show / Hide Table of Contents

Class MessageTracker

Maintains a timed cache of message IDs.

Inheritance
Object
MessageTracker
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: PeerTalk
Assembly: PeerTalk.dll
Syntax
public class MessageTracker
Remarks

RecentlySeen(String, Nullable<DateTime>) can be used to detect duplicate messages based on its ID.

Properties

| Improve this Doc View Source

Recent

The definition of recent.

Declaration
public TimeSpan Recent { get; set; }
Property Value
Type Description
TimeSpan

Defaults to 10 minutes.

Remarks

Messages that have been in the cache longer that this value will be removed and then be considered as "not seen".

Methods

| Improve this Doc View Source

Prune(DateTime)

Removes any message that is past its expiry date.

Declaration
public void Prune(DateTime now)
Parameters
Type Name Description
DateTime now

The current clock time.

| Improve this Doc View Source

RecentlySeen(String, Nullable<DateTime>)

Determines if the message has recently been seen.

Declaration
public bool RecentlySeen(string id, DateTime? now = default(DateTime? ))
Parameters
Type Name Description
String id

The unique identifier of a message.

Nullable<DateTime> now
Returns
Type Description
Boolean

true if the id has been recently seen; otherwise, false.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX