refactor: factor out task function validation
[poolifier.git] / benchmarks / versus-external-pools / functions / function-to-bench.js
index b95f560f0807d7e9b3a638fe2106f609b5f368ca..eca756b715d3a0052c99db37aafe9cc6ab1e3492 100644 (file)
@@ -1,10 +1,11 @@
+'use strict'
 /**
- * The worker function to execute during pools benchmarks.
- * NOTE: This function requires to be self-contained, thread-safe and re-entrant.
+ * The task function to execute during pools benchmarks.
+ * NOTE: This function requires to be self-contained, thread-safe and re-entrant (node-worker-threads-pool requirement).
  * @param {*} data The worker data.
  * @returns {*} The result.
  */
-function functionToBench (data) {
+const functionToBench = (data) => {
   const crypto = require('crypto')
   const fs = require('fs')
   const TaskTypes = {