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

Abierto
#250 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
r

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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().

Lenguaje dominante
C
Estrellas
252
Forks
87
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rstudio/httpuv

Todos los issues de rstudio/httpuv

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.