Skip to content

Class Queue

Kristian Virtanen edited this page Oct 16, 2024 · 3 revisions

Description:

The Queue class provides methods to create and manage multiple queues, each identified by a unique name. It allows values to be enqueued and dequeued, and also provides error handling via the LastError property, which stores the most recent error message if an operation fails.

Properties

Queue.LastError

  • Description: Stores the last error message, if any operation fails, including a timestamp in yyyy-MM-dd HH:mm:ss format.
  • Example: "2024-10-16 14:30:00: Queue with name 'myQueue' is either empty or does not exist."

Methods

Queue.EnqueueValue(queueName, value)

  • Description: Enqueues a value into the specified queue. If the queue does not exist, it is created.
  • Parameters:
    • queueName: The name of the queue to enqueue the value into.
    • value: The value to enqueue into the queue.
  • Returns: true if the value was successfully enqueued, false if an error occurred.

Queue.GetCount(queueName)

  • Description: Returns the number of items in the specified queue.
  • Parameters:
    • queueName: The name of the queue to get the item count from.
  • Returns: The number of items in the queue, or -1 if the queue does not exist.

Queue.DequeueValue(queueName)

  • Description: Dequeues the front value from the specified queue.
  • Parameters:
    • queueName: The name of the queue to dequeue the value from.
  • Returns: The value dequeued from the front of the queue, or null if the queue is empty or does not exist.

Top

Clone this wiki locally