Releases: mstephen19/nanolith
Releases · mstephen19/nanolith
Refaktorz & Teztz
Changed
- Updated concurrency multipliers to exclude
ConcurrencyOption.Default
. - Refactored
SharedMap.#isNull()
. - The
taskHandler
used withinService
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 onServiceCluster
. - Tests for
__beforeTask
and__afterTask
hooks with services & task workers.
Fixed
- Incorrect timeout error for creating writable streams.
ParentThread
in-editor docs.
Perfs & Configs
This version brings many minor but necessary bug fixes, performance improvements, and features.
Changed
createStream()
method onService
,Messenger
, andParentThread
to acceptRecord<string | number, any>
metadata instead ofRecord<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 totrue
+ docs.
Fixed
entries()
generator method onSharedMap
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 totrue
, notfalse
.
Harder, Better, Faster, Stronger
A whole lot of bug fixes & performance/memory efficiency updates in this version.
Fixed
- Not calling
getDefaultPoolConcurrency
in README example. - Improved performance for
ServiceCluster
methodscloseAll()
,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.identifier
property inPoolItemOptions
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
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
ServiceClusterOptions
and optionalautoRenew
option.- Accept exit codes in the
Service.close()
andexceptionHandler.terminate()
functions. SharedMap.delete()
method.- New clause to the license.
Fixed
SharedMap.get()
returningnull
for 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
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 theNanolith
instance, regardless of whether or not it is being run on the main thread.- Renamed
MainThread
toParentThread
to 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
pool
from 1 thread per core to 2 threads per core + docs update.
Added
- Test for the
safeMode
option 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
SharedMap
to be much more stable workerHandler
to exit the process with a code of1
when notype
is present onworkerData
.- 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
Changed
- Sentence in "Sharing memory between threads" section of the README.
.current
and.changed
from getter properties to functions on theSharedMapWatch
interface.#streamEventCallbacks
used byMessenger
'sMessagable
interop to be in aSet
instead of an array.- Various minor performance and memory improvements to
SharedMap
. ServiceCluster.launch
to return a tuple ofService
s when provided with the1
parameter instead of a singleService
. 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
Changed
Messenger.transfer
toMessenger.raw
+ renaming ofMessengerTransferData
type toMessengerRawData
SharedMap.transfer
toSharedMap.raw
+ renaming ofSharedMapTransferData
type 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 + testRemoveListenerFunction
return values for.onStream()
method onService
,MainThread
, andMessenger
.- More tests for
service_cluster
andstreams
suites. - New keywords to the package.json
Minor improvements
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 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.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
, andpool
. - Tests for streaming with
Messenger
+ a test suite forSharedMap