gradio
8a768cb4 - Let event listeners supply an ETA hint for queue estimates (#14080)

Commit
6 days ago
Let event listeners supply an ETA hint for queue estimates (#14080) * Let event listeners supply an ETA hint for queue estimates Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * add changeset * Make eta= hints work with executor="process" With the default process executor the queue runs in the gateway, which rebuilt each event from the config and the app's fn_settings without `eta`, so hints were ignored. The app process now sends a numeric `eta` in fn_settings, and for a callable the gateway's queue asks the app process for the hint with a new "eta" call (capped at 1s, falling back to the average of past runs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove code comments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Harden eta= hints - Run eta functions in a thread with a 1s timeout for both executors, so a slow one can't block the server's event loop. - Ignore non-finite results and cap hints at a day, since they are computed from raw client input. - Use running events' own hints for the time until a worker frees up, so queued events get an ETA before any run has finished. - Validate eta= when the listener is created (non-negative finite number or a function; numpy numbers accepted). - Recheck the queue's max_size after waiting for the hint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix ty error on fixed eta float conversion Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Check eta= file inputs, cap concurrent eta calls, reject async eta, add guide Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove the per-listener cap on concurrent eta calls Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Author
Parents
Loading