Support for the equivalent of javascript's `setInterval`
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by examining httpuv's WebSocket handling around the ws object and the server lifecycle, with the later-based example as the behavioral reference. Determine how a server-scheduled message API should work and ensure scheduled callbacks stop when the server is terminated; the issue does not name specific files or tests.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Most of the usage I've seen of httpuv's websocket functionality seems to use a method where the client will send a message which is then handled by the server which then responds with its own message.
For a project I am working on, a simpler solution is to have everything originate from the server which then sends a message on a scheduled basis out to the clients, i.e. something similar to what is possible with javascript's setInterval.
I've been able to achieve something like this by having a function recursively call itself with later on the desired interval,
onWSOpen = function(ws) {
interval = 2
f = function() {
msg = paste("Hello", Sys.time())
ws$send(msg)
later::later(f, interval)
}
f()
}
but this feels a bit hacky, and I'm currently stuck with the later calls persisting even after the server is terminated. I feel like I will be able to find a way of using the ws object and httpuv::listServers to include a halt condition, but again this feels super hacky.
- Lenguaje dominante
- C
- Estrellas
- 252
- Forks
- 87
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rstudio/httpuv
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 46/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Todos los issues de rstudio/httpuv
Issues similares
-
Status: Opened
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
FriendsofECCE/ECCE#1018 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
immortalwrt/immortalwrt#2522 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
luainkernel/lunatik#2530 ·
Los mantenedores suelen responder en 1 día