Skip to content

Commit 212203e

Browse files
authored
Merge pull request #18 from hpkv-io/feature/add-throttle
## Description This pull request introduces a comprehensive adaptive request throttling system to the HPKV WebSocket Client SDK along with significant code restructuring and documentation improvements. ### Throttling Feature - Added an **adaptive request throttling system** that dynamically adjusts request rates based on: - Network latency (Round Trip Time measurements) - Server responses (handling 429 Too Many Requests errors) - Configurable rate limits - Implemented queue management to ensure requests are processed optimally - Added exponential backoff for handling rate-limited scenarios - Provided monitoring capabilities for throttling metrics ### Code Refactoring - Reorganized file structure for better modularity: - Moved token management to utilities directory - Restructured WebSocket adapters for browser and Node.js environments - Consolidated exports in index files - Enhanced error handling and message processing - Improved type definitions and interfaces for better type safety - Created new `SimpleEventEmitter` for efficient event handling ### Documentation Updates - Added comprehensive documentation for the throttling feature in README.md - Included configuration examples and monitoring instructions - Added a table of contents for better navigation
2 parents e13b7d4 + 34320bb commit 212203e

25 files changed

Lines changed: 1768 additions & 819 deletions

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Currently, only the NodeJS SDK is available, with more language implementations
3535
## Available SDKs
3636

3737
### NodeJS
38+
[![npm version](https://img.shields.io/npm/v/@hpkv/websocket-client.svg)](https://www.npmjs.com/package/@hpkv/websocket-client)
39+
[![npm downloads](https://img.shields.io/npm/dm/@hpkv/websocket-client.svg)](https://www.npmjs.com/package/@hpkv/websocket-client)
3840

3941
- [NodeJS SDK Documentation](sdk/node/README.md)
4042
- Installation: `npm install @hpkv/websocket-client`
@@ -86,7 +88,7 @@ npm install @hpkv/websocket-client
8688

8789
- [HPKV Overview](https://hpkv.io/docs/overview)
8890
- [WebSocket API Documentation](https://hpkv.io/docs/websocket-api)
89-
- [Getting Started Guide](https://hpkv.io/docs/getting-started)
91+
- [SDKs Documentation](https://hpkv.io/docs/sdk-guides)
9092
- [Real-time Pub-Sub Blog Post](https://hpkv.io/blog/2025/03/real-time-pub-sub)
9193

9294
## License

sdk/node/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to the HPKV WebSocket Client SDK will be documented in this
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.2.7] - Released at 2025-04-27
9+
### Added
10+
- Dynamic Request Throttling feature
11+
812
## [1.2.6] - Released at 2025-04-22
913
### Changed
1014
- Enhanced connection and error management

0 commit comments

Comments
 (0)