Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Realtime Apps Using React.js and Pusher

Building Realtime Apps Using React.js and Pusher

ManilaJS meet up May 8, 2015

Joy Paas

May 08, 2015
Tweet

Other Decks in Programming

Transcript

  1. Polling • client connects to server periodically (e.g. every 30s,

    1min, etc) to get updates • updates can be delayed • unnecessary server calls when there are no changes • update occurrences happen at fixed intervals
  2. Push Notifications • server sends notification to client when updates

    are available • updates are up-to-date • no unnecessary server calls • update occurrences happen at different intervals
  3. Public (channel-name) no restrictions in joining channels ! Private (private-channel-name)

    requires user authentication before joining channel Pusher Channel Types
  4. Presence (presence-channel-name) requires user authentication before joining channel can access

    info about channel members can directly trigger events on other clients ! Pusher Channel Types
  5. Triggering Events Pusher server triggers events about channel subscription, etc.

    ! Your app’s API server can trigger any event, in any channel within the application (when app credentials are set correctly)
  6. Triggering Events Pusher’s debug console can trigger any event, in

    any channel within the application (for debug purposes)! From other clients (using presence channels) triggers client events (client-event-name) that other clients subscribed to the channel can receive.
  7. • Events are sometimes triggered when component is not mounted.

    • More errors happen as users have more interaction with a page. • Situation of other users must also be considered. • Difficult to debug. • Difficult to test.