v-daemon
Daemon script for v-spot-client
Installation
$ npm install v-daemon -g
Usage
Step01: Create script file to run. File basename will be the subject id
/home/scripts/v/jp.realglobe.v-daemon.example01
#!/usr/bin/env node /** * @file Example script to daemonize */'use strict' // verb and object passed as process argsconst subject verb object1 object2 = processargv
Step02: Daemonize the script
#!/bin/bash # Give script path to daemonize v-daemon /home/scripts/v/jp.realglobe.v-daemon.example01 -H "v-spot.cloud.com"
Step03: Call it from another client
#!/usr/bin/env node /** * Example to call daemonized script */'use strict' const vSpot = ;async { const spot = await spot // By default, subject name is generated from script name const example01 = await spot // Send the signal to daemon script via server await example01}
More Script Examples
Bash Script Example
#!/bin/bash # subject=$1verb=$2object1=$3object2=$4 echo "Unknown verb ${verb}"exit 1
CLI Help
Usage: v-daemon [options] <filename ...> Daemon script
API Guide
License
This software is released under the MIT License.