Class EventBus<TEvent, TClassifier, TSubscriber>
This class provides base publish/subscribe functionality for working with events inside the system.
Inherited Members
Namespace: Akka.Event
Assembly: Akka.dll
Syntax
public abstract class EventBus<TEvent, TClassifier, TSubscriber>
Type Parameters
Name | Description |
---|---|
TEvent | The type of event published to the bus. |
TClassifier | The type of classifier used to classify events. |
TSubscriber | The type of the subscriber that listens for events. |
Methods
| Improve this Doc View SourceClassify(TEvent, TClassifier)
Classifies the specified event using the specified classifier.
Declaration
protected abstract bool Classify(TEvent event, TClassifier classifier)
Parameters
Type | Name | Description |
---|---|---|
TEvent | event | The event that is being classified. |
TClassifier | classifier | The classifier used to classify the event. |
Returns
Type | Description |
---|---|
Boolean |
|
GetClassifier(TEvent)
Retrieves the classifier used to classify the specified event.
Declaration
protected abstract TClassifier GetClassifier(TEvent event)
Parameters
Type | Name | Description |
---|---|---|
TEvent | event | The event for which to retrieve the classifier. |
Returns
Type | Description |
---|---|
TClassifier | The classifier used to classify the event. |
IsSubClassification(TClassifier, TClassifier)
Determines whether a specified classifier, child
, is a subclass of another classifier, parent
.
Declaration
protected abstract bool IsSubClassification(TClassifier parent, TClassifier child)
Parameters
Type | Name | Description |
---|---|---|
TClassifier | parent | The potential parent of the classifier that is being checked. |
TClassifier | child | The classifier that is being checked. |
Returns
Type | Description |
---|---|
Boolean |
|
Publish(TEvent)
Publishes the specified event to the bus.
Declaration
public virtual void Publish(TEvent event)
Parameters
Type | Name | Description |
---|---|---|
TEvent | event | The event that is being published. |
Publish(TEvent, TSubscriber)
Publishes the specified event directly to the specified subscriber.
Declaration
protected abstract void Publish(TEvent event, TSubscriber subscriber)
Parameters
Type | Name | Description |
---|---|---|
TEvent | event | The event that is being published. |
TSubscriber | subscriber | The subscriber that receives the event. |
SimpleName(Object)
Retrieves the simplified type name (the class name without the namespace) of a given object.
Declaration
protected string SimpleName(object source)
Parameters
Type | Name | Description |
---|---|---|
Object | source | The object that is being queried. |
Returns
Type | Description |
---|---|
String | The simplified type name of the given object. |
SimpleName(Type)
Retrieves the simplified type name (the class name without the namespace) of a given type.
Declaration
protected string SimpleName(Type source)
Parameters
Type | Name | Description |
---|---|---|
Type | source | The object that is being queried. |
Returns
Type | Description |
---|---|
String | The simplified type name of the given type. |
Subscribe(TSubscriber, TClassifier)
Adds the specified subscriber to the list of subscribers that listen for particular events on the bus.
Declaration
public virtual bool Subscribe(TSubscriber subscriber, TClassifier classifier)
Parameters
Type | Name | Description |
---|---|---|
TSubscriber | subscriber | The subscriber that is being added. |
TClassifier | classifier | The classifier of the event that the subscriber wants. |
Returns
Type | Description |
---|---|
Boolean |
|
Unsubscribe(TSubscriber)
Removes the specified subscriber from the list of subscribers that listen for particular events on the bus.
Declaration
public virtual bool Unsubscribe(TSubscriber subscriber)
Parameters
Type | Name | Description |
---|---|---|
TSubscriber | subscriber | The subscriber that is being removed. |
Returns
Type | Description |
---|---|
Boolean |
|
Unsubscribe(TSubscriber, TClassifier)
Removes the specified subscriber from the list of subscribers that listen for particular events on the bus.
Declaration
public virtual bool Unsubscribe(TSubscriber subscriber, TClassifier classifier)
Parameters
Type | Name | Description |
---|---|---|
TSubscriber | subscriber | The subscriber that is being removed. |
TClassifier | classifier | The classifier of the event that the subscriber wants. |
Returns
Type | Description |
---|---|
Boolean |
|