-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
22 lines (20 loc) · 903 Bytes
/
index.ts
File metadata and controls
22 lines (20 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import type { RunFunction } from '@data-fair/lib-common-types/processings.js'
import type { ProcessingConfig } from './types/processingConfig/index.ts'
/**
* Function to execute the processing (triggered when the processing is started).
* This is the main function of the plugin where the business logic is implemented.
*/
export const run: RunFunction<ProcessingConfig> = async (context) => {
const { run } = await import('./lib/execute.ts')
return run(context)
}
/**
* Function to stop the processing (triggered when the processing is stopped).
* It is used to manage interruption and prevent incoherent state.
* The run method should finish shortly after calling stop.
* Not required, but can be useful for long processing or to prevent incoherent state in case of interruption.
*/
export const stop = async () => {
const { stop } = await import('./lib/execute.ts')
return stop()
}