Releases: mstephen19/nanolith
Releases · mstephen19/nanolith
Release list
Refaktorz & Teztz
Changed
- Updated concurrency multipliers to exclude
ConcurrencyOption.Default. - Refactored
SharedMap.#isNull(). - The
taskHandlerused withinServiceto 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
autoRenewoption onServiceCluster. - Tests for
__beforeTaskand__afterTaskhooks with services & task workers.
Fixed
- Incorrect timeout error for creating writable streams.
ParentThreadin-editor docs.
Perfs & Configs
This version brings many minor but necessary bug fixes, performance improvements, and features.
Changed
createStream()method onService,Messenger, andParentThreadto acceptRecord<string | number, any>metadata instead ofRecord<any, any>.
Added
- More info about
metaDatato Streaming data between threads section of README. Messenger.closedgetter.Service.setRef()method.shareEnvoption for task & service workers, defaulting totrue+ docs.
Fixed
entries()generator method onSharedMapto 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
reffedconfig option. Defaults totrue, notfalse.
Harder, Better, Faster, Stronger
A whole lot of bug fixes & performance/memory efficiency updates in this version.
Fixed
- Not calling
getDefaultPoolConcurrencyin README example. - Improved performance for
ServiceClustermethodscloseAll(),closeAllIdle(),use(), andactiveServiceCalls(). 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.identifierproperty inPoolItemOptionstype. Service.call()not cleaning up callbacks.Service.call()not decreasing active count upon promise rejection.- Minor performance improvement for
Messengerwith streams.
Added
- New tests for
ServiceCluster.use().
Removed
ParentThreadTerminateMessageBodytype eliminated.
A sink, a weight
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
Changed
- Minor refactors.
- README image.
Added
ServiceClusterOptionsand optionalautoRenewoption.- Accept exit codes in the
Service.close()andexceptionHandler.terminate()functions. SharedMap.delete()method.- New clause to the license.
Fixed
SharedMap.get()returningnullfor non-existent properties, but returning the string of'null'for existing properties with values set tonull.Service.call()hanging forever if the underlying task usesprocess.exit().
Childrens' childrens' children
Changed
poolto use shared values for the active count and concurrency count, enabling the spawning of new threads from other threads.poolto allow for the enqueuing of new items on all threads.define()to always return theNanolithinstance, regardless of whether or not it is being run on the main thread.- Renamed
MainThreadtoParentThreadto match the changes made above + update docs. - Change "performant" to "scalable" in "About" section in README.
- Renamed all
MainThread...message body types to beParentThread...instead. - Default max concurrency of
poolfrom 1 thread per core to 2 threads per core + docs update.
Added
- Test for the
safeModeoption withdefine(). 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
- Better error handling
- Stable mutex solution for
SharedMap
Changed
- Mutex solution for
SharedMapto be much more stable workerHandlerto exit the process with a code of1when notypeis present onworkerData.- Refactored
prepareWritableToPortStreamtimeout logic.
Removed
SharedMap.watchfunctionality + 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
Changed
- Sentence in "Sharing memory between threads" section of the README.
.currentand.changedfrom getter properties to functions on theSharedMapWatchinterface.#streamEventCallbacksused byMessenger'sMessagableinterop to be in aSetinstead of an array.- Various minor performance and memory improvements to
SharedMap. ServiceCluster.launchto return a tuple ofServices when provided with the1parameter instead of a singleService. Prevents potential bugs when providing dynamic numbers to the function.
Added
SharedMapWatchinterface with JSDoc documentation for each function.- Missing "
Serviceproperties & methods" section in README table of contents. - Small warning about
SharedMapto the README.
Removed
- Deleted
OLD_README.md
The Data Watcher
Changed
Messenger.transfertoMessenger.raw+ renaming ofMessengerTransferDatatype toMessengerRawDataSharedMap.transfertoSharedMap.raw+ renaming ofSharedMapTransferDatatype toMessengerRawData- Slightly lower bundle size by minimizing the size of the published package.json file.
Fixed
- Minor performance updates for
ServiceCluster.
Added
.watch()method toSharedMap+ docs + testRemoveListenerFunctionreturn values for.onStream()method onService,MainThread, andMessenger.- More tests for
service_clusterandstreamssuites. - New keywords to the package.json
Minor improvements
Fixed
- Typos in README.
SharedMap.optiononly accessible statically and not on instances.
Changed
MessengerList.list()to be a getter method instead of a regular function. New syntax isMessengerList.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.optionback 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, andpool. - Tests for streaming with
Messenger+ a test suite forSharedMap