yajsapi / Exports / executor/ctx / WorkContext
executor/ctx.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 |
StorageProvider | undefined |
emitter |
null | default<[StorageEvent ], void> |
null |
Defined in
• Private
_emitter: null
| default<[StorageEvent
], void>
Defined in
• Private
_id: any
Defined in
• Private
_pending_steps: Work[]
Defined in
• Private
_started: boolean
Defined in
• Private
_storage: StorageProvider
Defined in
▸ _prepare(): void
Returns
void
Defined in
▸ begin(): void
Returns
void
Defined in
▸ commit(__namedParameters?
): Work
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