repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: type namespace cleanup
[poolifier.git]
/
src
/
worker
/
abstract-worker.ts
diff --git
a/src/worker/abstract-worker.ts
b/src/worker/abstract-worker.ts
index 6c6de861156e040285fc3a4ad4c50ba5e796f04f..dc1f6adc02ba8a7b433f08ae8e4d3f4d9abe7b3d 100644
(file)
--- a/
src/worker/abstract-worker.ts
+++ b/
src/worker/abstract-worker.ts
@@
-18,7
+18,7
@@
import { KillBehaviors, type WorkerOptions } from './worker-options'
import type {
TaskAsyncFunction,
TaskFunction,
import type {
TaskAsyncFunction,
TaskFunction,
- TaskFunctionOperationRe
turnType
,
+ TaskFunctionOperationRe
sult
,
TaskFunctions,
TaskSyncFunction
} from './task-functions'
TaskFunctions,
TaskSyncFunction
} from './task-functions'
@@
-201,7
+201,7
@@
export abstract class AbstractWorker<
* @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): TaskFunctionOperationRe
turnType
{
+ public hasTaskFunction (name: string): TaskFunctionOperationRe
sult
{
try {
this.checkTaskFunctionName(name)
} catch (error) {
try {
this.checkTaskFunctionName(name)
} catch (error) {
@@
-221,7
+221,7
@@
export abstract class AbstractWorker<
public addTaskFunction (
name: string,
fn: TaskFunction<Data, Response>
public addTaskFunction (
name: string,
fn: TaskFunction<Data, Response>
- ): TaskFunctionOperationRe
turnType
{
+ ): TaskFunctionOperationRe
sult
{
try {
this.checkTaskFunctionName(name)
if (name === DEFAULT_TASK_NAME) {
try {
this.checkTaskFunctionName(name)
if (name === DEFAULT_TASK_NAME) {
@@
-253,7
+253,7
@@
export abstract class AbstractWorker<
* @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): TaskFunctionOperationRe
turnType
{
+ public removeTaskFunction (name: string): TaskFunctionOperationRe
sult
{
try {
this.checkTaskFunctionName(name)
if (name === DEFAULT_TASK_NAME) {
try {
this.checkTaskFunctionName(name)
if (name === DEFAULT_TASK_NAME) {
@@
-309,7
+309,7
@@
export abstract class AbstractWorker<
* @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): TaskFunctionOperationRe
turnType
{
+ public setDefaultTaskFunction (name: string): TaskFunctionOperationRe
sult
{
try {
this.checkTaskFunctionName(name)
if (name === DEFAULT_TASK_NAME) {
try {
this.checkTaskFunctionName(name)
if (name === DEFAULT_TASK_NAME) {
@@
-378,7
+378,7
@@
export abstract class AbstractWorker<
message: MessageValue<Data>
): void {
const { taskFunctionOperation, taskFunctionName, taskFunction } = message
message: MessageValue<Data>
): void {
const { taskFunctionOperation, taskFunctionName, taskFunction } = message
- let response!: TaskFunctionOperationRe
turnType
+ let response!: TaskFunctionOperationRe
sult
if (taskFunctionOperation === 'add') {
response = this.addTaskFunction(
taskFunctionName as string,
if (taskFunctionOperation === 'add') {
response = this.addTaskFunction(
taskFunctionName as string,