service() fails to run inside later::with_temp_loop()

Đang mở
#250 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
r
Lĩnh vực
backend, networking

Hướng nghiên cứu

Start with R/httpuv.R at lines 588-615, where service() and later::run_now() are involved, and compare the behavior inside later::with_temp_loop(). Reproduce the reported case using httpuv::service() and the documented global-loop workaround. Done means service() executes callbacks registered in the global loop without requiring that workaround.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Originally posted in https://github.com/rstudio/pagedown/issues/150

This issue is related to later >= 1.0.0 which introduces private event loops.

The first observation is that httpuv uses only the global event loop even if startServer() is called inside later::with_temp_loop().

The problem is that service() does not execute the callbacks registered in the global loop when called inside later::with_temp_loop().
This comes from the fact that later::run_now() executes the callbacks registered in the current loop.

https://github.com/rstudio/httpuv/blob/57e1d715587acd16b566a910551d08a399d96656/R/httpuv.R#L588-L615

For now, the workaround is to use later::with_loop(later::global_loop(), httpuv::service()) instead of httpuv::service().

Ngôn ngữ chính
C
Star
252
Fork
87
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rstudio/httpuv

Tất cả issue của rstudio/httpuv

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.