Skip to content

feat: implement session management methods#34

Merged
joaquinbejar merged 1 commit intomainfrom
M1/issue-14-session-management
Mar 7, 2026
Merged

feat: implement session management methods#34
joaquinbejar merged 1 commit intomainfrom
M1/issue-14-session-management

Conversation

@joaquinbejar
Copy link
Owner

Summary

Implement WebSocket-specific session management methods as specified in issue #14.

Changes

New Methods on DeribitWebSocketClient

  • set_heartbeat(interval): Enable heartbeats with specified interval (10-3600 seconds)
  • disable_heartbeat(): Disable heartbeat messages
  • hello(client_name, client_version): Send client identification to server

Files Modified

  • src/constants.rs: Added PUBLIC_SET_HEARTBEAT, PUBLIC_DISABLE_HEARTBEAT constants
  • src/message/request.rs: Added request builder methods with documentation
  • src/client.rs: Implemented client methods with proper error handling
  • tests/unit/message.rs: Added 8 unit tests for request builders

API Methods

Method Deribit API Description
set_heartbeat(interval) public/set_heartbeat Enable heartbeats with interval
disable_heartbeat() public/disable_heartbeat Disable heartbeats
hello(name, version) public/hello Client identification

Testing

  • All 290 unit tests pass
  • make lint-fix
  • make pre-push

Closes #14

Implement WebSocket-specific session management methods:
- set_heartbeat(interval): Enable heartbeats with specified interval (10-3600 seconds)
- disable_heartbeat(): Disable heartbeat messages
- hello(client_name, client_version): Send client identification to server

Changes:
- Add PUBLIC_SET_HEARTBEAT, PUBLIC_DISABLE_HEARTBEAT constants
- Add request builder methods for session management
- Implement client methods with proper error handling
- Add 8 unit tests for request builders

Closes #14
@joaquinbejar joaquinbejar merged commit b066de0 into main Mar 7, 2026
11 checks passed
@joaquinbejar joaquinbejar deleted the M1/issue-14-session-management branch March 7, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement session management methods (set_heartbeat, disable_heartbeat, hello)

1 participant