Was this page helpful?

TransactionalQueue<T> Class

    Table of Contents
    public class TransactionalQueue<T>
    Namespace: MindTouch.Collections
    Assembly: mindtouch.dream
    Type Hierarchy:
    • object
      • TransactionalQueue<T>
    Implements:
    A specialized queue that uses a two-phase dequeue to retrieve items

    Remarks

    Items dequeued are invisible to other users of the queue, but are not permanently removed until the dequeue is either committed, or rolled back, the latter action making the item availabe for dequeuing again

    Generic Parameters

    Parameter T

    Type of entries in the queue
    Constraints:
    none

    Members

    Constructors

    Visibility Description
    Public TransactionalQueue(IQueueStream stream, IQueueItemSerializer<T> serializer) Create a new Queue given an MindTouch.IO.IQueueStream storage provider and an MindTouch.IO.IQueueItemSerializer<T> serializer for type T.

    Properties

    Visibility Description
    Public DefaultCommitTimeout The default timeout used for a dequeued item before the item is considered abandoned and automatically rolled back
    Public Count The current count of items available for TransactionalQueue<T>.Dequeue()

    Methods

    Visibility Description
    Public Clear() Clear out the queue and drop all items, including pending commits.
    Public Enqueue(T item) Put an item into the queue
    Public Dequeue() Get the next available item from the queue. Must call TransactionalQueue<T>.CommitDequeue(long id) to fully take possession or the item. Uses TransactionalQueue<T>.DefaultCommitTimeout.
    Public Dequeue(TimeSpan commitTimeout) Get the next available item from the queue. Must call TransactionalQueue<T>.CommitDequeue(long id) to fully take possession or the item.
    Public CommitDequeue(long id) Completes the two-phase TransactionalQueue<T>.Dequeue().
    Public RollbackDequeue(long id) Undo TransactionalQueue<T>.Dequeue() and return item back to the queue.
    Public Dispose() Clean up the resources used by the Queue per the System.IDisposable pattern
    Public ToString() (Inherited from Object)
    Public Equals(object obj) (Inherited from Object)
    Public GetHashCode() (Inherited from Object)
    Public GetType() (Inherited from Object)
    Protected MemberwiseClone() (Inherited from Object)
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by