Queue class abstract

An abstract class that represents a postgresql message queue.

Constructors

Queue.create(Pool pool, String queueName)
factory
Queue.createUsingPrismaClient(BasePrismaClient<BasePrismaClient> prismaClient, String queueName)
factory

Properties

controllers List<StreamController<Message>>
A StreamController that allows for listening to incoming messages from the queue.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

archive(int messageID) Future<int?>
Archives a message in the queue. messageID : id of the message to archive
delete(int messageID) Future<int?>
Deletes a message from the queue. messageID : id of the message to delete
dispose() Future<void>
Dispose of any resources associated with the queue.
dropQueue() Future<void>
Drops the queue, effectively removing it from the database
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pausablePull({required Duration duration, Duration? visibilityDuration, bool useReadMethod = true}) → (PausableTimer, Stream<Message>)
pop() Future<Message?>
Reads a single message from a queue and deletes it upon read.
pull({required Duration duration, Duration? visibilityDuration, bool useReadMethod = true}) Stream<Message>
Continuously pulls messages from the queue for the specified duration.
purgeQueue() Future<int?>
Purges all messages from the queue.
read({int? maxReadNumber, Duration? visibilityTimeOut}) Future<List<Message>?>
Read 1 (by default) or more messages from a queue. The visibilityTimeOut specifies the amount of time in seconds that the message will be invisible to other consumers after reading.
send(Map<String, dynamic> payload) Future<int?>
Sends a message to the queue with the specified payload.
setVisibilityTimeout({required int messageID, required Duration duration}) Future<Message?>
Set visibility timeout of a message
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited