Skip to content
This repository has been archived by the owner on Sep 4, 2018. It is now read-only.
/ lightningStreamer Public archive

lightning component to subscribe to a streaming push topic and broadcast all messages received as a lightning event

Notifications You must be signed in to change notification settings

mshanemc/lightningStreamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Deprecated. Archived.

You should not use this for anything--use the new lightning:empApi (winter19 release).


LightningStreamer

  1. gets a sessionId via apex
  2. subscribes to a push topic or platform event that you set as an attribute
  3. listens for messages, and emits the messages uncensored as a lightning standard application event
  4. Then your other components listen for that event

Setup

  • Install
  • create a push topic or platform event (google if you don't know how)
  • use in another component or in your app like this
<c:Streamer topic="someTopicYouMade"/>

or

<c:Streamer platformEvent="My_Event__e"/>

other components should listen thusly:

<aura:handler event="ltng:sendMessage" action="{!c.doSomething}"/>

in the controller handler function:

var message = event.getParam("message");
var channel = event.getParam("channel"); //channel = 'streamingAPISubscriber'

the message is the typical streaming api message: message.data.sobject (streaming topic) or message.data.payload (events)

Philosopy

Streamer is very stupid, it just listens and repeats everthing it hears--no traffic control or directed communications.

It's the job of the other components to handle all messages, deciding what they should do with them, if anything.

Deploy to Salesforce

About

lightning component to subscribe to a streaming push topic and broadcast all messages received as a lightning event

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published