Skip to content

Move heart beat task into MapToolClient - #5263

Merged
cwisniew merged 1 commit into
RPTools:developfrom
kwvanderlinde:refactor/5262-better-manage-ServerHeartBeatThread
Feb 15, 2025
Merged

Move heart beat task into MapToolClient#5263
cwisniew merged 1 commit into
RPTools:developfrom
kwvanderlinde:refactor/5262-better-manage-ServerHeartBeatThread

Conversation

@kwvanderlinde

@kwvanderlinde kwvanderlinde commented Feb 15, 2025

Copy link
Copy Markdown
Collaborator

Identify the Bug or Feature request

Closes #5262

Description of the Change

The ServerHeartBeatThread thread is removed in favour of a task (Runnable) scheduled repeatedly with an executor. This task is only scheduled when MapToolClient is started, and it is canceled when MapToolClient is stopped. So each connection will get its own heart beat unlike before.

Possible Drawbacks

None

Documentation Notes

N/A

Release Notes

  • Modify server heart beats to not busy-wait on a thread.

This change is Reviewable

The new task is scheduled with a `ScheduledExecutorService` so we don't have to manage our own thread or run a busy wait
loop.
@kwvanderlinde kwvanderlinde self-assigned this Feb 15, 2025
@github-actions github-actions Bot added the refactor Refactoring the code for optimal awesomeness. label Feb 15, 2025
@cwisniew
cwisniew added this pull request to the merge queue Feb 15, 2025
Merged via the queue into RPTools:develop with commit d9f4146 Feb 15, 2025
@kwvanderlinde
kwvanderlinde deleted the refactor/5262-better-manage-ServerHeartBeatThread branch May 15, 2025 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring the code for optimal awesomeness.

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

[Refactoring]: Better manage ServerHeartBeatThread

2 participants