Class: WorkContext
An object used to schedule commands to be sent to provider.
• new WorkContext(
ctx_id
, storage
, emitter?
)Parameters
Name | Type | Default value |
---|---|---|
ctx_id | string | undefined |
storage | undefined | |
emitter | null |
Defined in
Defined in
•
Private
_id: any
Defined in
Defined in
•
Private
_started: boolean
Defined in
Defined in
▸ _prepare():
void
Returns
void
Defined in
▸ begin():
void
Returns
void
Defined in
Creates sequence of commands to be sent to provider.
Parameters
Name | Type |
---|---|
__namedParameters | Object |
__namedParameters.timeout? | number |
Returns
Work object (the latter contains sequence commands added before calling this method)
Defined in
▸ download_file(
src_path
, dst_path
): void
Schedule downloading remote file from the provider.
Parameters
Name | Type | Description |
---|---|---|
src_path | string | remote (provider) path |
dst_path | string | local (requestor) path |
Returns
void
Defined in
▸ log(
args
): void
Parameters
Name | Type |
---|---|
args | any |
Returns
void
Defined in
▸ run(
cmd
, args?
, env?
): void
Schedule running a command.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
cmd | string | undefined | command to run on the provider, e.g. /my/dir/run.sh |
args? | Iterable | undefined | command arguments, e.g. "input1.txt", "output1.txt" |
env | null | object | null | optional object with environmental variables |
Returns
void
Defined in
▸ send_file(
src_path
, dst_path
): void
Schedule sending file to the provider.
Parameters
Name | Type | Description |
---|---|---|
src_path | string | local (requestor) path |
dst_path | string | remote (provider) path |
Returns
void
Defined in
▸ send_json(
json_path
, data
): void
Schedule sending JSON data to the provider.
Parameters
Name | Type | Description |
---|---|---|
json_path | string | remote (provider) path |
data | Object | object representing JSON data |
Returns
void
Defined in
▸ sign():
void
Returns
void
Defined in
Last modified 1yr ago