-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEvent.cs
57 lines (47 loc) · 1.92 KB
/
Event.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using NFX;
using NFX.DataAccess.Distributed;
namespace Agni.Social.Graph
{
/// <summary>
/// Represents and event that is emitted into the GraphEventSystem
/// </summary>
[Serializable]
public struct Event
{
/// <summary>
/// Creates a new GraphNode with new GDID
/// </summary>
public static Event MakeNew(GDID gEmitterNode, string eType, GDID gTargetShard, GDID gTarget, string config)
{
//todo pereipsat na imnovaniy gdid
var gdid = GDID.Zero;//AgniSystem.GDIDProvider.GenerateOneGDID(SysConsts.GDID_NS_SOCIAL, SysConsts.GDID_NAME_SOCIAL_EVENT);
var utcNow = App.TimeSource.UTCNow;
return new Event(gdid, utcNow, gEmitterNode, eType, gTargetShard, gTarget, config);
}
internal Event(GDID gdid, DateTime utcTimestamp, GDID gEmitterNode, string eType, GDID gTargetShard, GDID gTarget, string config)
{
GDID = gdid;
TimestampUTC = utcTimestamp;
G_EmitterNode = gEmitterNode;
EventType = eType;
G_TargetShard = gTargetShard;
G_Target = gTarget;
Config = config;
}
/// <summary>Unique ID of the event itself</summary>
public readonly GDID GDID;
/// <summary>Event creation UTC timestamp</summary>
public readonly DateTime TimestampUTC;
/// <summary>GDID of the emitter node</summary>
public readonly GDID G_EmitterNode;
/// <summary>Event type per particular business system</summary>
public readonly string EventType;
/// <summary>The sharding gdid of the target (such as a GDID of the user where post is stored)</summary>
public readonly GDID G_TargetShard;
/// <summary>The GDID of the target that this event represents, (such as the GDID of the post on user's wall)</summary>
public readonly GDID G_Target;
/// <summary>Arbitrary parameters in Laconic format</summary>
public readonly string Config;
}
}