spark on disconnect

This block is part of the websocket group and was last modified in core v10.4.28.

spark on disconnect v10.4.28

Executes a given function if a spark disconnects.

In pins 1 + flow
  • flow
    flow
  • clear all
    condition

    Clears all previously given disconnect function

Out pins 3 + flow
  • flow
    flow
  • success
    condition
  • error
    value
  • on disconnect
    execute_function

Registers the function wired to on_disconnect to run LATER, when the current WebSocket connection drops; the block itself returns immediately with success=true, and the function receives the connection's channel list on its channels pin. success=false with error "No spark found" without a WebSocket, DISCONNECT_NOT_SUPPORTED when the connection cannot register callbacks, or "No function connected" when on_disconnect is unwired. Does nothing in simulation. The clearall pin is declared but not read by the Go executor.

A typical wiring for spark on disconnect: a function trigger starts the flow; the function out pin wires to an execute block.

Studio canvas example for the spark on disconnect block: typical wiring for spark on disconnect.

Version history

Introduced in v10.4.28.


Back to websocket Return to the main group to view all sub-groups Back to websocket Return to the group to view all blocks within this group