Struct Envelope
Represents the envelope of a message published to a data stream. See Message<T> for details.
Namespace: Microsoft.Psi
Assembly: Microsoft.Psi.dll
Syntax
public struct Envelope
Constructors
View SourceEnvelope(DateTime, DateTime, Int32, Int32)
Initializes a new instance of the Envelope struct.
Declaration
public Envelope(DateTime originatingTime, DateTime creationTime, int sourceId, int sequenceId)
Parameters
Type | Name | Description |
---|---|---|
DateTime | originatingTime | The OriginatingTime of this message. |
DateTime | creationTime | The CreationTime of the message. |
System.Int32 | sourceId | The SourceId of the message. |
System.Int32 | sequenceId | The unique SequenceId of the message. |
Fields
View SourceCreationTime
The message creation time.
Declaration
public DateTime CreationTime
Field Value
Type | Description |
---|---|
DateTime |
OriginatingTime
The originating time of the message, representing the time of the real-world event that led to the creation of this message. This value is used as a key when synchronizing messages across streams. This value must be propagated with any message derived from this message.
Declaration
public DateTime OriginatingTime
Field Value
Type | Description |
---|---|
DateTime |
SequenceId
The sequence number of this message, unique within the stream identified by SourceId.
Declaration
public int SequenceId
Field Value
Type | Description |
---|---|
System.Int32 |
SourceId
The id of the stream that generated the message.
Declaration
public int SourceId
Field Value
Type | Description |
---|---|
System.Int32 |
Methods
View SourceEquals(Object)
Determines whether two instances are equal.
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
Object | other | The object to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | True if the instances are equal. |
GetHashCode()
Returns a hash code for this instance, obtained by combining the hash codes of the instance fields.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hashcode. |
ToString()
Provide a string representation of this Timestamped instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | Payload preceded by originating time. |
Operators
View SourceEquality(Envelope, Envelope)
Determines whether two instances are equal.
Declaration
public static bool operator ==(Envelope first, Envelope second)
Parameters
Type | Name | Description |
---|---|---|
Envelope | first | The first object to compare. |
Envelope | second | The object to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | True if the instances are equal. |
Inequality(Envelope, Envelope)
Determines whether two instances are equal.
Declaration
public static bool operator !=(Envelope first, Envelope second)
Parameters
Type | Name | Description |
---|---|---|
Envelope | first | The first object to compare. |
Envelope | second | The object to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | True if the instances are equal. |