Class QueueEmulatorItem
Представляет класс, который реализует возможность общения с имитируемой очередью.
Inheritance
System.Object
QueueEmulatorItem
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Terrasoft.Core.Process
Assembly: Terrasoft.Core.dll
Syntax
public class QueueEmulatorItem : IMessageQueueManagerItem, IDisposable
Constructors
QueueEmulatorItem(Action<TaskServiceQueueItem>)
Инициализирует экземпляр TaskServiceQueueItem с заданным алгоритмом отправки сообщений.
Declaration
public QueueEmulatorItem(Action<TaskServiceQueueItem> sendMessageDel)
Parameters
Type | Name | Description |
---|---|---|
System.Action<TaskServiceQueueItem> | sendMessageDel | Алгоритм, реализующий отправку сообщения. |
Methods
Dispose()
Освобождает ресурсы.
Declaration
public void Dispose()
InvokeMessage(TaskServiceQueueItem)
Имитирует приходящее сообщение из очереди.
Declaration
public void InvokeMessage(TaskServiceQueueItem message)
Parameters
Type | Name | Description |
---|---|---|
TaskServiceQueueItem | message | Сообщение TaskServiceQueueItem |
Send(TaskServiceQueueItem, Byte)
Выполняет отправку сообщения.
Declaration
public void Send(TaskServiceQueueItem message, byte priority = 0)
Parameters
Type | Name | Description |
---|---|---|
TaskServiceQueueItem | message | Сообщение TaskServiceQueueItem. |
System.Byte | priority | Приоритет отправки сообщения. Значение по умолчанию - 0 (приоритет не используется). |
Events
Error
Событие генерируется в результате возникновения ошибки при отправке или получении сообщения.
Declaration
public event Action<string> Error
Event Type
Type | Description |
---|---|
System.Action<System.String> |
ReceiveMessage
Событие, возникающее при получении нового сообщения.
Declaration
public event Action<TaskServiceQueueItem> ReceiveMessage
Event Type
Type | Description |
---|---|
System.Action<TaskServiceQueueItem> |
Implements
System.IDisposable