SteamDeckHomebrew / decky-loader

A plugin loader for the Steam Deck.
https://decky.xyz
GNU General Public License v2.0
4.25k stars 154 forks source link

[Request] Add guaranteed time available for finish onDismount method in frontend #612

Open steam3d opened 2 months ago

steam3d commented 2 months ago

Please confirm

Feature Request Description

Some plugins must finish their background work before start them again. In cases: update, reload.

I suggest adding deferral parameter in OnDismount method that will give plugins fixed time like 1 second to stop their background job before Decky will run them again.

Further Description

No response

AAGaming00 commented 2 months ago

better option is to make onDismount async (if it isn't already?) and await it

RodoMa92 commented 2 months ago

better option is to make onDismount async (if it isn't already?) and await it

I agree. It seems that it's not the default behaviour right now from a quick glance.

steam3d commented 2 months ago

The Decky simple calls: https://github.com/SteamDeckHomebrew/decky-loader/blob/b84dcd99adbffcc2710fb916c35f698dc57fea2c/frontend/src/plugin-loader.tsx#L216

https://github.com/SteamDeckHomebrew/decky-loader/blob/b84dcd99adbffcc2710fb916c35f698dc57fea2c/frontend/src/plugin.ts#L6