Skip to content
Andrés edited this page Aug 17, 2016 · 7 revisions

Pusher is a simple hosted API for quickly, easily and securely integrating real time bi-directional functionality via WebSockets to web and mobile apps, or any other Internet connected device.


How it will be used in MARLO?

  • Real Time Notifications: Alert notifications to all users connected in a certain time (e.g. when server is going to restart, to inform about something important)
  • Activity streams: Be able to know how the users are interacting with the platform (e.g. when submitting or saving a specific project, request the addition of a new partner, to know the specific field that are editing, etc.)
  • Webhooks: Allow the MARLO server to be notified about events that are happening with the Pusher service
  • Live reports: Real time statistics reports (e.g. Percentage of completeness for each project, amount of users editing or viewing at a certain time, etc.)

Channels

Channels are a fundamental concept in Pusher. Each application has a number of channels, and each client can choose which channels it subscribes to.

  • Public channels - Can be subscribed to be any user registered into the platform
  • Private channels - Lets your server control access to the data you are broadcasting
  • Presence channels - Let you ‘register’ user information on subscription, and let other members of the channel know who’s online

Events

Events are the primary method of packaging messages in the Pusher system. they form the basis of all communication.


Authenticating users

Application security is very important so Pusher provides a mechanism for authenticating a user’s access to a channel at the point of subscription.


MARLO Global Channel & Events

  • presence-global
  • Event : client-system-reset
{ 
"message": "This message is to inform you that we are going to restart the server in order to apply some improvements ...", 
  	"diffTime" : "120" 
}
  • Event : client-simple-notification
{ 
"message": "message here"
}
  • presence-{crp}-{actionName}: Subscribed in any section

  • presence-program-{crp}-{actionName}-{crpProgramID} : Subscribed to an Impact pathway section

  • presence-project-{crp}-{actionName}-{projectID} : Subscribed to a project section

  • Event: pusher:subscription_succeeded

  • (Array of Members)

  • Event: pusher:member_added

  • (Member Object)

  • Event: pusher:member_removed

  • (Member Object)

  • Event: client-section-saved

  • (Member Object)

"member" : { 
 	"id": "{sessionID}",  
    "info": { "name" : "John Doe", "color" : "{sessionColor}" } 
}