feat(websocket): affinity configuration #963
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add CPU core affinity to websocket thread configuration. Otherwise simple parsing code like cJSON may pin it unexpectedly.
Testing
This was tested by printing the affinity on event receipt. We could add a test to run a WS client on each core if desired, as well as unpinned.
Checklist
Before submitting a Pull Request, please ensure the following:
Note
Adds configurable CPU core affinity for the websocket client task and pins it using xTaskCreatePinnedToCore.
esp_websocket_client_config_twithtask_core_id_setandtask_core_idto allow specifying CPU affinity.WEBSOCKET_TASK_CORE_IDdefault (tskNO_AFFINITY).task_core_idin internalwebsocket_config_storage_t; set from config or default.xTaskCreatewithxTaskCreatePinnedToCore(..., client->config->task_core_id)to pin client task to the chosen core.Written by Cursor Bugbot for commit 21f4c53. This will update automatically on new commits. Configure here.