Show / Hide Table of Contents

Class ObjectQueue<T>

Represents a first-in, first-out queue for a generic object type. The queue implemented by this class is thread-safe, and it also blocks readers in case of an empty queue. This queue has especially been designed to act as a work queue in multi-threaded applications.

Inheritance
System.Object
ObjectQueue<T>
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: Juhta.Net.Common
Assembly: Juhta.Net.dll
Syntax
public class ObjectQueue<T>
Type Parameters
Name Description
T

Specifies an object type.

Constructors

| Improve this Doc View Source

ObjectQueue()

Initializes a new instance.

Declaration
public ObjectQueue()

Properties

| Improve this Doc View Source

Count

Gets the number of elements contained in the object queue specified by this ObjectQueue instance.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

Close()

Closes the object queue specified by this ObjectQueue instance. The operation releases all threads that are blocked by the current instance.

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

GetObject()

Gets the next object from the object queue specified by this ObjectQueue instance.

Declaration
public T GetObject()
Returns
Type Description
T

Returns the next instance of T from the queue. The return value is null only, if the queue was initially empty and the queue had been closed prior to the call or no object became available before the queue was closed during the call.

| Improve this Doc View Source

PutObject(T)

Puts an object to the object queue specified by this ObjectQueue instance.

Declaration
public void PutObject(T object)
Parameters
Type Name Description
T object

Specifies an object.

  • Improve this Doc
  • View Source
Back to top Copyright © 2017-2019 Juha Lähteenmäki
Generated by DocFX