Module: Notifier

AeroGear. Notifier

new Notifier(config) → {Object}

Status: Deprecated
The AeroGear.Notifier namespace provides a messaging API. Through the use of adapters, this library provides common methods like connect, disconnect, subscribe, unsubscribe and publish.
Parameters:
Name Type Argument Description
config String | Array | Object <optional>
A configuration for the client(s) being created along with the notifier. If an object or array containing objects is used, the objects can have the following properties:
Properties
Name Type Argument Default Description
name String the name that the client will later be referenced by
type String <optional>
"vertx" the type of client as determined by the adapter used
settings Object <optional>
{} the settings to be passed to the adapter
Deprecated:
  • since 2.1.0 and will be removed in a future release.
    Source:
    Returns:
    The created notifier containing any messaging clients that may have been created
    Type
    Object
    Example
        // Create an empty notifier
        var notifier = AeroGear.Notifier();
    
        // Create a single client using the default adapter
        var notifier2 = AeroGear.Notifier( "myNotifier" );
    
        // Create multiple clients using the default adapter
        var notifier3 = AeroGear.Notifier( [ "someNotifier", "anotherNotifier" ] );
    
        // Create a default adapter with settings
        var notifier4 = AeroGear.Notifier({
            name: "vertxNotifier",
            type: "vertx",
            settings: { ... }
        });
    
        // Create a stompws adapter with settings
        var notifier5 = AeroGear.Notifier({
            name: "STOMPNotifier",
            type: "stompws",
            settings: { ... }
        });
    
        // Create a vertx and stompws adapter with settings
        var notifier6 = AeroGear.Notifier([
            {
                name: "vertxNotifier",
                type: "vertx",
                settings: { ... }
            },
            {
                name: "STOMPNotifier",
                type: "stompws",
                settings: { ... }
            }
        ]);

    Extends

    • AeroGear.Core

    Members

    <static> adapters

    The adapters object is provided so that adapters can be added to the AeroGear.Notifier namespace dynamically and still be accessible to the add method
    Source:

    <static> CONNECTING

    A set of constants used to track the state of a client connection.
    Source:

    <static> this.collectionName :Object

    The name used to reference the collection of notifier client instances created from the adapters
    Type:
    • Object
    Default Value:
    • modules
    Source: