Skip to content

Releases: mstephen19/nanolith

Stability

28 Dec 23:02
Compare
Choose a tag to compare

Removed

  • __beforeServiceTask and __afterServiceTask hooks in favor of universal __beforeTask and __afterTask hooks with new context.

Changed

  • README streaming examples to use .shift() instead of .splice().
  • Context of TaskHooks to contain the name of the task being called and whether or not it's being called within a service.
  • ServiceCluster.launch to disallow negative or non-whole numbers.
  • Rename parent to MainThread, which makes much more sense anyways since the parent thread is always the main thread in Nanolith.
  • Rename messengers to MessengerList.
  • Rename MessengerList.seek() to MessengerList.list().
  • General overall refactor + minor performance improvements.
  • README revamp.

Fixed

  • __afterTask hook being called after the returned value was posted back to the main thread instead of before.
  • Weird exclusion of HookDefinitions keys in Tasks type.
  • Needing to close all SharedMap instances, otherwise the thread would hang even if nothing else is happening.
  • Errors when initializing SharedMap with an empty object.

Added

  • Functionality for setting new keys on SharedMap instances rather than throwing an error.
  • The ability to set new values on SharedMap based on the previous value. This is fantastic for high-concurrency parallel operations and eliminates all race conditions.
  • Nanolith.clusterize method for easy creation of a service cluster and launching services all at the same time.

Sharing is caring

22 Dec 11:17
Compare
Choose a tag to compare

Features 🆕

Fixes & improvements 🛠️

  • Add a timeout of 15 seconds to allow a stream to be accepted before the promise is rejected with createStream() on Messenger.
  • Change TaskWorkerOptions and ServiceWorkerOptions types to be exported as LaunchTaskOptions and LaunchServiceOptions instead.
  • Export SharedArrayPair, MessengerTransfer, and SharedMapTransfer types.
  • Switch messenger.transfer() to be a getter property instead of a method.
  • Change pool.option to be a static property.

Messenger to the rescue

08 Dec 20:54
Compare
Choose a tag to compare

Features 🆕

  • Streaming data between the main thread and a service.
  • Streaming data between threads with Messenger
  • Replaced offMessage() with listener-remover functions returned from onMessage() calls

Fixes & improvements 🛠️

  • MessengerTransferObject issues within __initializeService() hook calls
  • Minor performance improvements to Messenger

Streams are nice

06 Dec 00:25
Compare
Choose a tag to compare

Features 🆕

  • waitForMessage() method on Messenger and Service
  • Streaming data between threads!

Fixes & improvements 🛠️

  • parent.waitForMessenger() not working when registered in an __initializeService() hook call.

All patched up

03 Dec 01:04
Compare
Choose a tag to compare

Features 🆕

  • Added automatically generated identifiers to the define() function. Manually providing them is still possible, but no longer necessary.
  • Removed messages object in favor of the new identical messengers object.
  • Removed launchService() on ServiceCluster in favor of the new launch() method.

Fixes & improvements 🛠️

  • Eradicated the maxListeners error when calling a high volume of tasks on a Service.
  • Various performance improvements.
  • Lowered bundle size by disabling declaration map files.

Performance Matters

30 Nov 14:49
d317f32
Compare
Choose a tag to compare

Features 🆕

  • TaskDefinitions, Nanolith, TaskWorkerOptions, and ServiceWorkerOptions types now available at the top-level.
  • closeAll() and setRef() methods on Messenger.
  • Deprecated messages object in favor of the new identical messengers object.
  • Deprecated launchService() on ServiceCluster in favor of the new launch() method.

Fixes & improvements 🛠️

  • Large performance improvements for ServiceCluster.
  • Slight performance improvements for Service.
  • Slight performance improvements for Messenger.
  • Disabled the max-listeners memory leak warning for all Worker instances (this is temporary).

The Polished Pearl

02 Nov 12:07
Compare
Choose a tag to compare

Added

  • activeCalls property to Service + docs.
  • __beforeServiceTask and __afterServiceTask hooks + docs.
  • safeMode option to DefineOptions + docs.
  • "License" section to the README

Changed

  • Fixed various typos in README and JSDoc comments + general improvements.
  • Removed calling and called events from Service.
  • Same-file calling to be handled on the define() level instead of within runTaskWorker or runServiceWorker.
  • Description in package.json to "Multithreaded nanoservices in no time with seamless TypeScript support."
  • "About" section in README.

Captain's Hooks

24 Oct 19:11
Compare
Choose a tag to compare

Features

  • Support for an automatically called __initializeService hook when launching a service.
  • Support for new __beforeTask and __afterTask hooks when calling a task.
  • closeAllIdle() method and currentServices property on ServiceCluster.
  • Support for an identifier parameter in the .use() method on ServiceCluster.
  • threadID and raw worker properties now available on Service instances.
  • New waitForMessage() function under parent.
  • New seek() function under messages.

Fixes

  • Possible EventEmitter memory leak detected error (thrown from Worker instances when calling many tasks on a service) fixed by cleaning up all listeners and increasing the limit with setMaxListeners.

Service-mania

11 Oct 23:04
Compare
Choose a tag to compare

After making some final improvements and fixes on the 0.0.1 beta releases, I'm extremely proud to announce the first stable and ready-to-go version of Nanolith - v0.1.0.

This version brings a new feature to the table - ServiceCluster, which allows you to manage and allocate task loads amongst multiple services with just a few lines of code.

Busty Beta

04 Oct 22:28
Compare
Choose a tag to compare
Busty Beta Pre-release
Pre-release
0.0.1-beta3

docs(readme): typo