Class TypePrefixSubscription
This subscription matches on topics based on a prefix of the type and maps to agents using the source of the topic as the agent key. This subscription causes each source to have its own agent instance.
- Inheritance
-
Type
Prefix Subscription
- Implements
- Inherited Members
Remarks
Constructors
TypePrefixSubscription(string, AgentType, string?)
Initializes a new instance of the Type
Parameters
topicTypePrefix
stringTopic type prefix to match against.
agentType
AgentType Agent type to handle this subscription.
id
stringUnique identifier for the subscription. If not provided, a new UUID will be generated.
Properties
AgentType
Gets the agent type that handles this subscription.
Property Value
Id
Gets the unique identifier of the subscription.
Property Value
TopicTypePrefix
Gets the topic type prefix used for matching.
Property Value
Methods
Equals(object?)
Determines whether the specified object is equal to the current subscription.
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true
if the specified object is equal to this instance; otherwise,false
.
GetHashCode()
Returns a hash code for this instance.
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures.
MapToAgent(TopicId)
Maps a Topic
Parameters
topic
TopicId The topic to map.
Returns
Exceptions
- Invalid
Operation Exception Thrown if the topic does not match the subscription.
Matches(TopicId)
Checks if a given Topic
Parameters
topic
TopicId The topic to check.
Returns
- bool
true
if the topic's type starts with the subscription's prefix,false
otherwise.