I use some GRASS tools in QGIS Python Console. All tools I use return a dictionary with a key and a value which contains string path, like this: {"output": "file/path"}. There is an answer here. It suggests to use that string in QgsVectorLayer. But writing/reading a file to/from disk is time consuming.
I tried processing.runAndLoadResults and processing.run. Both add a layer. But before adding the layer, they save the layer to disk, then add it.
processing.run("grass7:v.buffer", {..., 'output':'TEMPORARY_OUTPUT', ...})
# returns {'output': '/tmp/.../output.gpkg'} -> file path
processing.runAndLoadResults("grass7:v.buffer", , {..., 'output':'TEMPORARY_OUTPUT', ...})
returns {'output': '/tmp/.../output.gpkg'} -> file path
I wonder, is there a way to get the returned/added layer by the GRASS tool without saving to disk (to use in the next processing tool in a Python script)?