Search Results for

    Show / Hide Table of Contents

    Class MessageCollection

    A collection of messages.

    Inheritance
    Object
    MessageCollection
    MessageCollection<T1, T2>
    Implements
    IDisposable
    Namespace: Agents.Net
    Assembly: Agents.Net.dll
    Syntax
    public abstract class MessageCollection : IEnumerable<Message>, IDisposable
    Remarks

    This is a helper class for the MessageCollector<T1, T2>

    Methods

    | Improve this Doc View Source

    Dispose()

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

    Dispose(Boolean)

    Disposes all MessageStore<T>s contained in this collection

    Declaration
    protected abstract void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing
    Remarks

    This releases the usage of the message and therefore potentially disposes the contained Message. When a message is used more than once in the MessageCollector<T1, T2>, the Agent that contains the MessageCollector<T1, T2> should mark the message with DelayDispose().

    | Improve this Doc View Source

    GetAllMessages()

    When overridden needs to return all messages in the collection.

    Declaration
    protected virtual IEnumerable<Message> GetAllMessages()
    Returns
    Type Description
    IEnumerable<Message>
    | Improve this Doc View Source

    GetEnumerator()

    Declaration
    public IEnumerator<Message> GetEnumerator()
    Returns
    Type Description
    IEnumerator<Message>
    | Improve this Doc View Source

    MarkAsConsumed(Message)

    Mark the specified message as consumed.

    Declaration
    public abstract void MarkAsConsumed(Message message)
    Parameters
    Type Name Description
    Message message

    The message that will be marked.

    Remarks

    The usual behavior for the MessageCollector<T1, T2> is to retain all messages that were collected, until other message of the same type replaces the the old message. This method changes that behavior, so that the marked message is removed from the collector afterwards.

    Implements

    IDisposable
    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright Tobias Wilker and contributors