Starting a kernel and invoking code with JSON-RPC

Good morning,

I have the following issue. I would like to start a kernel (python or R) via a REST request and then send JSON-RPC request so that I can run code without having a websocket connection open. The kernel_gateway package seem to provide the first service, but still only supports websockets to perform operations in the kernel. See conversation here

With RPC requests (or REST API requests to invoke somehow function calls or resource creation/state setting) I would be able to work completely disconnected and asynchronous (e.g. invoke a routine and retrieve the result at a later time), instead of having to rely on a websocket that needs to be kept alive.

Do you have any suggestions on this use case?