Frontend API

@Injectable() export class NetworkMessageHandler

Handle the messages of the network subprotocol from flow-based programming network protocol.

Protocol for starting and stopping FBP networks, and finding out about their state.

This subprotocol description can be found here : https://flowbased.github.io/fbp-protocol/#network-start

Created by antoine on 20/06/17.

handleMessage (msg: Object)

Redirect the given message to the proper handler method.

private status (msg: Object)

Store the status of the network.

https://flowbased.github.io/fbp-protocol/#network-status

private stopped (msg: Object)

An execution stopped. This method stores the last run’s timestamp of the network and broadcast the network’s stop event to the rest of the app.

https://flowbased.github.io/fbp-protocol/#network-stopped

private started (msg: Object)

An execution stopped. This method stores the last start’s timestamp of the network and broadcast the network’s start event to the rest of the app.

https://flowbased.github.io/fbp-protocol/#network-started

private output (msg: Object)

An output message from a running network, roughly similar to STDOUT output of a Unix process, or a line of console.log in JavaScript. Output can also be used for passing images from the runtime to the UI.

The message will be logged in the browser’s console.

https://flowbased.github.io/fbp-protocol/#network-output

private error (msg: Object)

An error from a running network, roughly similar to STDERR output of a Unix process, or a line of console.error in JavaScript.

The message will be logged in the browser’s console errors.

https://flowbased.github.io/fbp-protocol/#network-error

private persist (msg: Object)

The full workflow has been saved. Alert the user of this event.

https://flowbased.github.io/fbp-protocol/#network-persist

private startNode (msg: object)

A given node has started running. Broadcast this event across the app. This event is mainly used to highlight the running nodes on the workflow.

This is a custom add to the protocol

private finishNode (msg: object)

A given node has stopped running. Broadcast this event across the app. This event is mainly used to remove the highlight of the node to the workflow.

This is a custom add to the protocol