golemfactory / golem-electron

Graphical user interface for Golem Project

Home Page:https://golem.network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support graceful shutdown

kmazurek opened this issue · comments

Golem core includes logic for shutting down gracefully (if there are any tasks running, core is put into a state where it does not accept any new tasks and waits for the pending ones to finish before shutting down). This state can be toggled using the RPC golem.graceful_shutdown.

This could be utilised in Electron, with shutdown state being triggered on exit and toggled off (if necessary) when Electron is started again.

So the only required parameter is boolean I suppose?

@jamuszyn As discussed, this will require some design work from you. @mdtanrikulu What parameter do you mean here?

@zakaprov For the RPC usage, to toggle etc.

graceful_shutdown(true, "some other paramter if needed")

The relevant RPC (golem.graceful_shutdown) takes no parameters, it works as a simple toggle. The status for the shutdown is returned in the response from the RPC (enum ShutdownResponse in Golem core). Any feedback for the user should be based on this response.