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.
- Parameters:
msg
— the received network message
private status (msg: Object)
Store the status of the network.
https://flowbased.github.io/fbp-protocol/#network-status
- Parameters:
msg
— the ‘network:status’ message
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
- Parameters:
msg
— the ‘network:stopped’ message
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
- Parameters:
msg
— the ‘network:started’ message
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
- Parameters:
msg
— the ‘network:output’ message
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
- Parameters:
msg
— the ‘network:error’ message
private persist (msg: Object)
The full workflow has been saved. Alert the user of this event.
https://flowbased.github.io/fbp-protocol/#network-persist
- Parameters:
msg
— the ‘network:persist’ message
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
- Parameters:
msg
— the ‘network:startnode’ message
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
- Parameters:
msg
— the ‘network:finishnode’ message