stream

.j. stream

# new stream()

Access object to the SSE stream logic

Members

# (static) close :callable

to execute when the stream is disconnected
Type:
  • callable

# (static) connect :callable

function to connect to the stream server
Type:
  • callable

# (static) connectionErrors :number

the number of occured connection errors (to only try a few times and then stop)
Type:
  • number

# (static) error :callable

to execute when the stream loses connection or fails to connect
Type:
  • callable

# (static) message :callable

to execute when the stream receives something from the server
Type:
  • callable

# (static) open :callable

to execute when the stream is connected
Type:
  • callable

Methods

# (static) connectIfNotConnected() → {boolean}

Function to make sure that a connection is established
Returns:
true on success
Type
boolean

# (static) event(eventname, callback)

function to override the stream callbacks
Parameters:
Name Type Description
eventname string the name of the event
callback Callable a callback to exeute when the event occurs