-
Notifications
You must be signed in to change notification settings - Fork 0
Class Queue
Kristian Virtanen edited this page Oct 28, 2024
·
3 revisions
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.
-
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."
- Differences from orig. SB: New feature (and class) for SBOE.
- 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. - Differences from orig. SB: New feature (and class) for SBOE.
- 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. - Differences from orig. SB: New feature (and class) for SBOE.
- 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. - Differences from orig. SB: New feature (and class) for SBOE.
- Description: Removes queue with name passed as parameter.
-
Parameters:
-
queueName
: The name of the queue to remove.
-
- Returns: true if queue removed succesfully, false if not.
- Differences from orig. SB: New feature (and class) for SBOE.