Streaming Event API

In this initial version we have added slt_stream API which works on pg_notify. if any user has added shift comment, shift annotation, shift comment reply or started or ended the shift all the other user will be notified in real time using this API.

There are six possible output of this API

Shift Started / Created

data: {"action" : "shift_created", "data": ""}

Shift Ended / Stopped

data: {"action" : "shift_ended", "data": ""}

Shift Annotation

data: {"action" : "annotation_created", "data": ""}

Shift Comment Version History

data: {"action" : "comment_updated", "data": ""}

Shift Comment Create / Update

data: {"action" : "comment_created", "data": ""}

Shift Comment Reply

data: {"action" : "reply_added", "data": ""}

Shift Comment Logs

data: {"action" : "logs_added", "data": ""}

Note

Sending this heartbeat every 30 sec for keeping the connection alive on browser (in 45 sec browser closes the connection if no data received)

data: {"type": "heartbeat"}