A complete rewritten version of Hamok with a new API and a new architecture. Also an accidental publishing of this version before it was ready due to a working github action.
Another accidental publishing of this version before it was ready due to a working github action.
A ready version to use (hopefully)
- Add
JOIN_NOTIFICATION
message type to the message protocol - Introucing
join()
method
- skipped, indicating a significant change applied to the library in the coming version.
- Added
STORAGE_HELLO_NOTIFICATION
message type to the message protocol. - Added
STORAGE_STATE_NOTIFICATION
message type to the message protocol. - Removed
import
method fromHamok
in favor of the unifiedjoin
method. - Removed
export
method fromHamok
in favor of the unifiedjoin
method. - Removed
start
method fromHamok
in favor of the unifiedjoin
method. - Removed
stop
method fromHamok
in favor of theleave
method. - Added
close
method toHamok
to close all resources. - Added an
ready
promise to all storage components, allowing for awaiting until the storage is ready and initialized. - Updated
HamokConnection
to join before sending any message exceptStorageHello
andStorageState
. - Removed the restriction of log gap errors between connected peers. The follower now picks up whatever it can, with the storage responsible for providing up-to-date snapshots to a remote peer through
StorageState
notifications. - Fixed a bug where a follower would vote for a candidate even if it had a leader.
- Added auto-rejoin functionality for
Hamok
when the connection is lost, provided it was in the joined state. - Fixed a bug where detached remote peers were not detected if the peer was a follower and lost all connections. (Added
_checkRemotePeers
method for this). - Added
ready
promise toHamok
to await until theHamok
is ready and initialized.
- Fixed a bug where the leader would not send a
StorageState
notification to a follower when the follower was behind the leader. - Fixed bug of remaining remote peer not part of the grid due to follower ENDPOINT_STATE_NOTIFICATION contained a wrong endpoint.
- Changing follower behavior when falling out of the grid. Instead of trying to collect endpoints, it periodically sends JOIN_NOTIFICATION until a leader is not elected for the endpoint
- Update
HamokEmitter
to have metaData property bind to subscriber peers per events.
- Add Subscriptions to
HamokEmitter
to track the subscribers of an event.- Add
HamokEmitterStats
to track the number of events emitted and received by the emitter.
- Add
- Simplifying discovery and joining methods in
Hamok
.