You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use of refresh_interval_failure in #1366 made me wonder if it can be applied to other blocks in a generic way.
Here is a rough idea: when an error in a block occurs, the block's state will be set to error_state and the text will be set according to error_format. Then the block will be restarted after error_interval. Clicking on the block will show the full error message. Clicking again will hide the full error message.
There is a major issue though: some blocks spawn threads. The situation is better for async implementation, as those threads are at least abortable (edit: spawn_blocking() is not really abortable).
The text was updated successfully, but these errors were encountered:
Actually, it might be easier than I thought. There's no need to fully restart the blocks. Instead, each block can be composed of failable but recoverable parts.
As an example, here's a part of github's block from my prototype:
let total = api.recoverable(|| get_total(&request),"Oh no!").await?;
That's it. Nothing else needed on the block's side. That's how it looks:
The use of
refresh_interval_failure
in #1366 made me wonder if it can be applied to other blocks in a generic way.Here is a rough idea: when an error in a block occurs, the block's state will be set to
error_state
and the text will be set according toerror_format
. Then the block will be restarted aftererror_interval
. Clicking on the block will show the full error message. Clicking again will hide the full error message.There is a major issue though: some blocks spawn threads. The situation is better for async implementation, as those threads are at least abortable (edit:
spawn_blocking()
is not really abortable).The text was updated successfully, but these errors were encountered: