Skip to content

Releases: mstephen19/nanolith

Refaktorz & Teztz

30 Apr 21:40
bd57e51
Compare
Choose a tag to compare

Changed

  • Updated concurrency multipliers to exclude ConcurrencyOption.Default.
  • Refactored SharedMap.#isNull().
  • The taskHandler used within Service to avoid unnecessary looping. Minor performance improvement.
  • ServiceCluster.use() implementation to be more logical and performant.
  • Minor refactors for define().
  • Minor refactors for Pool.

Added

  • Extra test for autoRenew option on ServiceCluster.
  • Tests for __beforeTask and __afterTask hooks with services & task workers.

Fixed

  • Incorrect timeout error for creating writable streams.
  • ParentThread in-editor docs.

Perfs & Configs

30 Mar 20:03
457e840
Compare
Choose a tag to compare

This version brings many minor but necessary bug fixes, performance improvements, and features.

Changed

  • createStream() method on Service, Messenger, and ParentThread to accept Record<string | number, any> metadata instead of Record<any, any>.

Added

  • More info about metaData to Streaming data between threads section of README.
  • Messenger.closed getter.
  • Service.setRef() method.
  • shareEnv option for task & service workers, defaulting to true + docs.

Fixed

  • entries() generator method on SharedMap to be more performant.
  • Messenger.closeAll() not closing the current messenger instance.
  • Improved general performance for services.
  • Improved general performance for task workers & services.
  • Incorrect docs for reffed config option. Defaults to true, not false.

Harder, Better, Faster, Stronger

10 Apr 01:43
a84a4d0
Compare
Choose a tag to compare

A whole lot of bug fixes & performance/memory efficiency updates in this version.

Fixed

  • Not calling getDefaultPoolConcurrency in README example.
  • Improved performance for ServiceCluster methods closeAll(), closeAllIdle(), use(), and activeServiceCalls().
  • Service.close() not doing early cleanup for callbacks.
  • Messenger.close() not doing early cleanup for stream event callbacks.
  • define() waiting to run the worker before resolving with the Nanolith API object.
  • Missing workerData.identifier property in PoolItemOptions type.
  • Service.call() not cleaning up callbacks.
  • Service.call() not decreasing active count upon promise rejection.
  • Minor performance improvement for Messenger with streams.

Added

  • New tests for ServiceCluster.use().

Removed

  • ParentThreadTerminateMessageBody type eliminated.

A sink, a weight

03 Mar 18:38
e5c7611
Compare
Choose a tag to compare

Changed

  • Some minor refactors.

Added

  • SharedMap.entries() method for asynchronously iterating over map keys and values + docs.
  • More keywords to package.json.

Fixed

  • Task/service calls throwing an error when the worker exits early with exit code 0.
  • Some JSDoc typos & unnecessary spaces.
  • SharedMap keys containing unnecessary commas that take up extra space.

Removed

  • Empty Examples section in README.
  • Replaced content in README License section with a link to the license in the GitHub repository.

Pawlished

08 Feb 19:45
c1186bf
Compare
Choose a tag to compare

Changed

  • Minor refactors.
  • README image.

Added

  • ServiceClusterOptions and optional autoRenew option.
  • Accept exit codes in the Service.close() and exceptionHandler.terminate() functions.
  • SharedMap.delete() method.
  • New clause to the license.

Fixed

  • SharedMap.get() returning null for non-existent properties, but returning the string of 'null' for existing properties with values set to null.
  • Service.call() hanging forever if the underlying task uses process.exit().

Childrens' childrens' children

05 Feb 20:09
Compare
Choose a tag to compare

Changed

  • pool to use shared values for the active count and concurrency count, enabling the spawning of new threads from other threads.
  • pool to allow for the enqueuing of new items on all threads.
  • define() to always return the Nanolith instance, regardless of whether or not it is being run on the main thread.
  • Renamed MainThread to ParentThread to match the changes made above + update docs.
  • Change "performant" to "scalable" in "About" section in README.
  • Renamed all MainThread... message body types to be ParentThread... instead.
  • Default max concurrency of pool from 1 thread per core to 2 threads per core + docs update.

Added

  • Test for the safeMode option with define().
  • getDefaultPoolConcurrency() function exported from root + docs.

Additionally, set up automatic publishing workflow. Any code merged to the main branch gets published. This means no more working on the main branch - it is now strictly for merging/pushing prod-ready code with a bumped version number.

Refactoring & Performance

21 Jan 18:48
Compare
Choose a tag to compare
  • Better error handling
  • Stable mutex solution for SharedMap

Changed

  • Mutex solution for SharedMap to be much more stable
  • workerHandler to exit the process with a code of 1 when no type is present on workerData.
  • Refactored prepareWritableToPortStream timeout logic.

Removed

  • SharedMap.watch functionality + docs.
  • Warning in README about parallel operations with SharedMap.

Added

  • Throw an error when no task name is provided when running a task worker.

Minor fixes & optimizations

11 Jan 16:37
Compare
Choose a tag to compare

Changed

  • Sentence in "Sharing memory between threads" section of the README.
  • .current and .changed from getter properties to functions on the SharedMapWatch interface.
  • #streamEventCallbacks used by Messenger's Messagable interop to be in a Set instead of an array.
  • Various minor performance and memory improvements to SharedMap.
  • ServiceCluster.launch to return a tuple of Services when provided with the 1 parameter instead of a single Service. Prevents potential bugs when providing dynamic numbers to the function.

Added

  • SharedMapWatch interface with JSDoc documentation for each function.
  • Missing "Service properties & methods" section in README table of contents.
  • Small warning about SharedMap to the README.

Removed

  • Deleted OLD_README.md

The Data Watcher

30 Dec 14:07
Compare
Choose a tag to compare

Changed

  • Messenger.transfer to Messenger.raw + renaming of MessengerTransferData type to MessengerRawData
  • SharedMap.transfer to SharedMap.raw + renaming of SharedMapTransferData type to MessengerRawData
  • Slightly lower bundle size by minimizing the size of the published package.json file.

Fixed

  • Minor performance updates for ServiceCluster.

Added

  • .watch() method to SharedMap + docs + test
  • RemoveListenerFunction return values for .onStream() method on Service, MainThread, and Messenger.
  • More tests for service_cluster and streams suites.
  • New keywords to the package.json

Minor improvements

30 Dec 01:40
Compare
Choose a tag to compare

Fixed

  • Typos in README.
  • SharedMap.option only accessible statically and not on instances.

Changed

  • MessengerList.list() to be a getter method instead of a regular function. New syntax is MessengerList.list.
  • SharedMap.get() to use .subarray() instead of .slice() for a slight memory complexity improvement.
  • README logo image to new blue version.
  • Improve validation in SharedMap's constructor.
  • pool.option back to a regular getter property instead of a static one. Doesn't need to be static.

Added

  • New sections to README for properties & methods of Service, ServiceCluster, and pool.
  • Tests for streaming with Messenger + a test suite for SharedMap