Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve scheduling of write tasks on a locked socket #6052

Merged
merged 2 commits into from Dec 15, 2023
Merged

Conversation

philippjfr
Copy link
Member

A continuation of #6028 that schedules tasks that write messages to the socket connection using asyncio rather than curdoc.add_next_tick_callback ensuring that they can be dispatched as soon as possible, while still avoiding the:

RuntimeError: _pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes

error.

Fixes #5999

Copy link

codecov bot commented Dec 15, 2023

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (aa61fe6) 84.68% compared to head (5010dff) 84.69%.
Report is 1 commits behind head on main.

Files Patch % Lines
panel/io/document.py 47.50% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6052      +/-   ##
==========================================
+ Coverage   84.68%   84.69%   +0.01%     
==========================================
  Files         295      295              
  Lines       43918    43929      +11     
==========================================
+ Hits        37193    37207      +14     
+ Misses       6725     6722       -3     
Flag Coverage Δ
ui-tests 40.69% <47.50%> (-0.01%) ⬇️
unitexamples-tests 72.80% <17.50%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@philippjfr philippjfr merged commit 3fff3de into main Dec 15, 2023
13 checks passed
@philippjfr philippjfr deleted the write_task_async branch December 15, 2023 12:40
philippjfr added a commit that referenced this pull request Dec 15, 2023
* Improve scheduling of write tasks on a locked socket

* Add write lock
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.

Preview with Panel does not work with async callbacks
1 participant