Manage the Sequence

Use data input and output

Scramjet Cloud Platform (SCP) can handle various inputs. As a developer, you are free to process any of them in your Sequence applications, such as: Text, JSON, XML, SOAP, Audio, Video and more. Inputs can be either:

  1. Provided to Hub via its REST API
  2. Consumed from various local or remote sources by the app; such as: Stream, STDIN, File, API, URL
  3. Generated by the app itself
si instance input <id> [<file>] # the instance id or '-' for the last one started or selected. # the input file (stdin if not given default)

Our engine outputs can be managed in several ways:

  1. File - you can save your output to a local or a remote file
  2. STDOUT - output can be directed to system STDOUT (STDERR is supported as well)
  3. API - output can be consumed from our SCP REST API
  4. URL Request - you can write your app in a way to request URL, webhook etc
  5. Stream - output can be streamed to a particular destination

You can mix multiple actions together: you can both send data to remote system/URL and save it locally.

To pipe running instance output to stdout:

si instance output <id> # the instance id or '-' for the last one started or selected.

Use Control Messages

Control the Sequence and send data to it thanks to the messages described below.

CODE DESCRIPTION
FORCE_CONFIRM_ALIVE Confirm that sequence is alive when it is not responding.
KILL Send kill running sequence signal.
MONITORING_RATE Used to change the sequence monitoring rate.
STOP Send stop the running sequence signal.
EVENT Send event name and any object, array, function to the sequence.
PONG Acknowledge message from CSH to Runner. The message includes the Sequence configuration information.

Use monitoring

CODE DESCRIPTION
ACKNOWLEDGE Indicating whether the command with message (e.g. stop or kill) was received.
DESCRIBE_SEQUENCE Includes info of stream mode, name, description and scalability of each subsequence.
STATUS Includes info of host address, instance_id, sequence modifications, health checks, data time flow, etc.
ALIVE Information on how much longer the Sequence will be active (in milliseconds).
ERROR All errors that occur.
MONITORING Contains messages about sequence health and information about instance resource usage like: cpu, memory, memory usage, net i/o, and disk size.
EVENT Execute defined event in sequence with additional message as a parameter.
PING Check if a runner is ready to communicate with.
SNAPSHOT_RESPONSE Status about snapshot communicates if snapshot is done created without error.
SEQUENCE_STOPPED Status about sequence communicates if it is running or not.

Monitoring health check

Information about the Sequence overall health (including information about functions).

cat test.txt | curl -H "Content-Type: application/json" -d "[5001, {2000}]" http://localhost:8000/api/v1/sequence/health { "healthy": true, "sequences": [ { "throughput": 0.1, "buffer": 0, "processing": 3, "pressure": 30 } ] }