Class Topics
Static factory methods for Dapr-compatible topic strings following the domain spec's naming scheme.
public static class Topics
- Inheritance
-
Topics
- Inherited Members
Methods
ActMarket(string, string)
Market topic for live data: act.market.{entity}.{event}.
public static Topic ActMarket(string entity, string eventName)
Parameters
entitystringEntity segment (e.g.
tick,orderbook).eventNamestringEvent segment (e.g.
received).
Returns
Build(string, string, string)
Build a topic from a generic shape: {domain}.{entity}.{event}.
Used internally for tests and dynamic topic construction.
public static Topic Build(string domain, string entity, string eventName)
Parameters
domainstringDomain prefix (e.g.
sc.S7F3A9B.trade,act.market).entitystringEntity segment.
eventNamestringEvent segment.
Returns
HypMarket(string, string, string)
Market topic for hypothetical data: hyp.{selector}.market.{entity}.{event}.
public static Topic HypMarket(string selector, string entity, string eventName)
Parameters
selectorstringMarket selector (e.g.
BTC_202101_202206).entitystringEntity segment.
eventNamestringEvent segment.
Returns
Position(ScenarioId, string, string)
Position topic: sc.{scenarioId}.position.{entity}.{event}.
public static Topic Position(ScenarioId scenarioId, string entity, string eventName)
Parameters
scenarioIdScenarioIdScenario id.
entitystringEntity (always
positionper the domain spec).eventNamestringEvent (e.g.
opened,updated,closed,flipped).
Returns
PublishAsync(IEventPublisher, Topic, IEventEnvelope, object)
Convenience: emit an envelope-payload pair to a topic. Wraps the payload in a CloudEvent using ToCloudEvent(IEventEnvelope, object?, string).
public static Task PublishAsync(this IEventPublisher publisher, Topic topic, IEventEnvelope envelope, object payload)
Parameters
publisherIEventPublisherPublisher to use.
topicTopicDestination topic.
envelopeIEventEnvelopeEnvelope carrying routing metadata.
payloadobjectEvent payload.
Returns
Risk(ScenarioId, string, string)
Risk topic: sc.{scenarioId}.risk.{entity}.{event}.
public static Topic Risk(ScenarioId scenarioId, string entity, string eventName)
Parameters
scenarioIdScenarioIdScenario id.
entitystringEntity (e.g.
pnl,drawdown,limit,margin,exposure).eventNamestringEvent (e.g.
updated,realized,breached,called).
Returns
Trade(ScenarioId, string, string)
Trade topic: sc.{scenarioId}.trade.{entity}.{event}.
public static Topic Trade(ScenarioId scenarioId, string entity, string eventName)
Parameters
scenarioIdScenarioIdScenario id.
entitystringEntity (e.g.
order,fill,execution,transfer,interest).eventNamestringEvent (e.g.
placed,cancelled,received).