summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b0b55f5)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
export type {
TaskAsyncFunction,
TaskFunction,
export type {
TaskAsyncFunction,
TaskFunction,
- TaskFunctionOperationReturnType,
+ TaskFunctionOperationResult,
TaskFunctions,
TaskSyncFunction
} from './worker/task-functions'
TaskFunctions,
TaskSyncFunction
} from './worker/task-functions'
import type {
TaskAsyncFunction,
TaskFunction,
import type {
TaskAsyncFunction,
TaskFunction,
- TaskFunctionOperationReturnType,
+ TaskFunctionOperationResult,
TaskFunctions,
TaskSyncFunction
} from './task-functions'
TaskFunctions,
TaskSyncFunction
} from './task-functions'
* @param name - The name of the task function to check.
* @returns Whether the worker has a task function with the given name or not.
*/
* @param name - The name of the task function to check.
* @returns Whether the worker has a task function with the given name or not.
*/
- public hasTaskFunction (name: string): TaskFunctionOperationReturnType {
+ public hasTaskFunction (name: string): TaskFunctionOperationResult {
try {
this.checkTaskFunctionName(name)
} catch (error) {
try {
this.checkTaskFunctionName(name)
} catch (error) {
public addTaskFunction (
name: string,
fn: TaskFunction<Data, Response>
public addTaskFunction (
name: string,
fn: TaskFunction<Data, Response>
- ): TaskFunctionOperationReturnType {
+ ): TaskFunctionOperationResult {
try {
this.checkTaskFunctionName(name)
if (name === DEFAULT_TASK_NAME) {
try {
this.checkTaskFunctionName(name)
if (name === DEFAULT_TASK_NAME) {
* @param name - The name of the task function to remove.
* @returns Whether the task function existed and was removed or not.
*/
* @param name - The name of the task function to remove.
* @returns Whether the task function existed and was removed or not.
*/
- public removeTaskFunction (name: string): TaskFunctionOperationReturnType {
+ public removeTaskFunction (name: string): TaskFunctionOperationResult {
try {
this.checkTaskFunctionName(name)
if (name === DEFAULT_TASK_NAME) {
try {
this.checkTaskFunctionName(name)
if (name === DEFAULT_TASK_NAME) {
* @param name - The name of the task function to use as default task function.
* @returns Whether the default task function was set or not.
*/
* @param name - The name of the task function to use as default task function.
* @returns Whether the default task function was set or not.
*/
- public setDefaultTaskFunction (name: string): TaskFunctionOperationReturnType {
+ public setDefaultTaskFunction (name: string): TaskFunctionOperationResult {
try {
this.checkTaskFunctionName(name)
if (name === DEFAULT_TASK_NAME) {
try {
this.checkTaskFunctionName(name)
if (name === DEFAULT_TASK_NAME) {
message: MessageValue<Data>
): void {
const { taskFunctionOperation, taskFunctionName, taskFunction } = message
message: MessageValue<Data>
): void {
const { taskFunctionOperation, taskFunctionName, taskFunction } = message
- let response!: TaskFunctionOperationReturnType
+ let response!: TaskFunctionOperationResult
if (taskFunctionOperation === 'add') {
response = this.addTaskFunction(
taskFunctionName as string,
if (taskFunctionOperation === 'add') {
response = this.addTaskFunction(
taskFunctionName as string,
- * Task function operation return type.
+ * Task function operation result.
-export interface TaskFunctionOperationReturnType {
+export interface TaskFunctionOperationResult {
status: boolean
error?: Error
}
status: boolean
error?: Error
}