hardbyte / hardbyte/python-can

`send_periodic` does not accept `on_error` callback, resulting in race condition

Abierto
#1,282 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Python
Estrellas
1.6k
Forks
697
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### Describe the bug
When setting up a periodic send task there is no way to configure the `on_error` callback in the task. Therefore, if the very first send attempt in the task fails, the task is aborted. This can happen before the user is able to add a callback to the newly created task. Thus there is a race condition between creating the task and sending the first message, and adding the callback.

### To Reproduce
Open a bus and create a periodic task. If sending to the bus fails, the task is aborted due to no callback being configured.

### Expected behavior
An argument is added to `send_periodic` such that the callback can be set in the constructor of the task.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.