Class StreamMessage
Represents message which content is represented by
Inherited Members
Namespace: DotNext.Net.Cluster.Messaging
Assembly: DotNext.Net.Cluster.dll
Syntax
public class StreamMessage : StreamTransferObject, IDisposableMessage, IMessage, IDataTransferObject, IDisposable
Constructors
| Improve this Doc View SourceStreamMessage(Stream, Boolean, String, ContentType)
Initializes a new message.
Declaration
public StreamMessage(Stream content, bool leaveOpen, string name, ContentType type = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | content | The message content. |
Boolean | leaveOpen | true to leave the stream open after StreamMessage object is disposed; otherwise, false. |
String | name | The name of the message. |
ContentType | type | Media type of the message. |
Properties
| Improve this Doc View SourceName
Gets name of this message.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
Type
Gets media type of this message.
Declaration
public ContentType Type { get; }
Property Value
Type | Description |
---|---|
ContentType |
Methods
| Improve this Doc View SourceCreateBufferedMessageAsync(IMessage, CancellationToken)
Creates copy of the original message stored in the managed heap.
Declaration
public static Task<StreamMessage> CreateBufferedMessageAsync(IMessage message, CancellationToken token = null)
Parameters
Type | Name | Description |
---|---|---|
IMessage | message | The origin message. |
CancellationToken | token | The token that can be used to cancel asynchronous operation. |
Returns
Type | Description |
---|---|
Task<StreamMessage> | The message which stores the content of the original message in the memory. |
Implements
IDisposable