Class InMemoryMessageChannel
Message channel, based on the queue and operate within a single process.
Namespace: StockSharp.Messages
Assembly: StockSharp.Messages.dll
Syntax
public class InMemoryMessageChannel : Object, IMessageChannel, IDisposable, ICloneable<IMessageChannel>, ICloneable
Constructors
InMemoryMessageChannel(IMessageQueue, String, Action<Exception>)
Initializes a new instance of the InMemoryMessageChannel.
Declaration
public InMemoryMessageChannel(IMessageQueue queue, string name, Action<Exception> errorHandler)
Parameters
Type | Name | Description |
---|---|---|
IMessageQueue | queue | Message queue. |
String | name | Channel name. |
Action<Exception> | errorHandler | Error handler. |
Properties
Disabled
The channel cannot be opened.
Declaration
public bool Disabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
MaxMessageCount
Max message queue count.
Declaration
public int MaxMessageCount { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
The default value is -1, which corresponds to the size without limitations.
MessageCount
Message queue count.
Declaration
public int MessageCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Name
Handler name.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
State
State.
Declaration
public ChannelStates State { get; }
Property Value
Type | Description |
---|---|
ChannelStates |
SuspendMaxCount
Suspend on SuspendTimeout if message queue is more than the specified count.
Declaration
public int SuspendMaxCount { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
SuspendTimeout
Declaration
public TimeSpan SuspendTimeout { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
Methods
Clone()
Create a copy of InMemoryMessageChannel.
Declaration
public virtual IMessageChannel Clone()
Returns
Type | Description |
---|---|
IMessageChannel | Copy. |
Close()
Close channel.
Declaration
public void Close()
Open()
Open channel.
Declaration
public void Open()
SendInMessage(Message)
Send message.
Declaration
public bool SendInMessage(Message message)
Parameters
Type | Name | Description |
---|---|---|
Message | message | Message. |
Returns
Type | Description |
---|---|
Boolean | true if the specified message was processed successfully, otherwise, false. |
Events
NewOutMessage
New message event.
Declaration
public event Action<Message> NewOutMessage
Event Type
Type | Description |
---|---|
Action<Message> |
StateChanged
State change event.
Declaration
public event Action StateChanged
Event Type
Type | Description |
---|---|
Action |
Explicit Interface Implementations
IMessageChannel.Clear()
Declaration
void IMessageChannel.Clear()
IMessageChannel.Resume()
Declaration
void IMessageChannel.Resume()
IMessageChannel.Suspend()
Declaration
void IMessageChannel.Suspend()
Implements
Ecng.Common.ICloneable<>