Class: ExeScriptExecutor
activity/exe-script-executor.ExeScriptExecutor
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new ExeScriptExecutor(activity
, activityModule
, logger
, options?
): ExeScriptExecutor
Parameters
Name | Type |
---|---|
activity | Activity |
activityModule | ActivityModule |
logger | Logger |
options? | ExecutionOptions |
Returns
Defined in
src/activity/exe-script-executor.ts:46
Properties
activity
• Readonly
activity: Activity
Defined in
src/activity/exe-script-executor.ts:47
Methods
execute
▸ execute(script
): Promise
<ScriptExecutionMetadata
>
Executes the provided script and returns the batch id and batch size that can be used to fetch it's results
Parameters
Name | Type |
---|---|
script | ExeScriptRequest |
Returns
Promise
<ScriptExecutionMetadata
>
script execution metadata - batch id and batch size that can be used to fetch results using getResultsObservable
Defined in
src/activity/exe-script-executor.ts:62
getResultsObservable
▸ getResultsObservable(batch
, stream?
, signalOrTimeout?
, maxRetries?
): Observable
<Result
<any
>>
Given a batch id and batch size collect the results from yagna. You can choose to either stream them as they go or poll for them. When a timeout is reached (by either the timeout provided as an argument here or in the constructor) the observable will emit an error.
Parameters
Name | Type | Description |
---|---|---|
batch | ScriptExecutionMetadata | batch id and batch size |
stream? | boolean | define type of getting results from execution (polling or streaming) |
signalOrTimeout? | number | AbortSignal | the timeout in milliseconds or an AbortSignal that will be used to cancel the execution |
maxRetries? | number | maximum number of retries retrieving results when an error occurs, default: 10 |
Returns
Observable
<Result
<any
>>
Defined in
src/activity/exe-script-executor.ts:102
send
▸ send(script
): Promise
<string
>
Parameters
Name | Type |
---|---|
script | ExeScriptRequest |
Returns
Promise
<string
>
Defined in
Was this helpful?