+ private checkWorkerOptions (opts: WorkerOptions) {
+ this.opts.killBehavior = opts.killBehavior ?? DEFAULT_KILL_BEHAVIOR
+ this.opts.maxInactiveTime =
+ opts.maxInactiveTime ?? DEFAULT_MAX_INACTIVE_TIME
+ /**
+ * Whether the worker is working asynchronously or not.
+ */
+ this.opts.async = !!opts.async
+ }
+
+ /**
+ * Check if the `fn` parameter is passed to the constructor.
+ *
+ * @param fn The function that should be defined.
+ */
+ private checkFunctionInput (fn: (data: Data) => Response): void {
+ if (!fn) throw new Error('fn parameter is mandatory')
+ }
+