Search Results for

    Show / Hide Table of Contents

    Class EventBus<TEvent, TClassifier, TSubscriber>

    This class provides base publish/subscribe functionality for working with events inside the system.

    Inheritance
    object
    EventBus<TEvent, TClassifier, TSubscriber>
    ActorEventBus<TEvent, TClassifier>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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

    | Edit this page View Source

    Classify(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
    bool

    true if the classification succeeds; otherwise false.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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
    bool

    true if the child classifier is a subclass of parent; otherwise false.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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
    bool

    true if the subscription succeeds; otherwise false.

    | Edit this page View Source

    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
    bool

    true if the subscription cancellation succeeds; otherwise false.

    | Edit this page View Source

    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
    bool

    true if the subscription cancellation succeeds; otherwise false.

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET