AngularJS V4 Stream Controller Tutorial for Realtime Apps

Stream Controller Overview

When enabled via the PubNub Admin Console, the Stream Controller feature provides PubNub developers the ability to efficiently subscribe to multiple channels via Channel Multiplexing (MXing) and Channel Groups.

The atomic components that make up a data stream are API Keys, Messages, and Channels.

NAME CONSIDERATIONS FOR CHANNELS AND CHANNEL GROUPS

PUBLISHING AND SUBSCRIBING REQUIRES ONLY A FEW SIMPLE-TO-USE APIS:

Channel and Channel Group names are UTF-8 compatible. Name length is limited to 64, and prohibited chars in a channel group are:

    • comma: ,
    • slash: /
    • backslash: \
    • period: .
    • asterisks: *
    • colon: :

CHANNEL MULTIPLEXING

To build an application that leverages the PubNub Network for Data Streams with Publish and Subscribe, you will need PubNub API Keys which we provide when you Sign-Up.

You will need at the minimum a subscribeKey and publishKey. If a client will only subscribe, and not publish, then the client only need to initialize with the subscribeKey. For clients who will be publishing only, or publishing and subscribing (a client can both publish and subscribe), it will need to initialize with both the subscribeKey and the publishKey.

You only need to supply the publishKey to clients that will publish (send) data to your application over the PubNub network. A read-only client for example would not need to initialize with this key.

MESSAGES OVERVIEW

A message consists of a channel, and its associated data payload. A publishing client publishes messages to a given channel, and a subscribing client receives only the messages associated with the channels its subscribed to.

PubNub Message payloads can contain any JSON data including Booleans, Strings, Numbers, Arrays, and Objects. Simply publish the native type per your platform, and the clients will JSON serialize the data for you. Subscribers will automatically deserialize the JSON for you into your platform's associated native type.

You only need to supply the publishKey to clients that will publish (send) data to your application over the PubNub network. A read-only client for example would not need to initialize with this key.

Send Your Feedback