When I call a python script from a "future" I receive the following error:
Listening on http://127.0.0.1:5147 Unhandled promise error: Failed to retrieve the value of MultisessionFuture () from cluster RichSOCKnode #1 (PID 23834 on localhost ‘localhost’). The reason reported was ‘error reading from connection’. Post-mortem diagnostic: Failed to determine whether a process with this PID exists or not, i.e. cannot infer whether localhost worker is alive or not.
source_python('./python_ref.py')
server <- function(input, output, session) {
observeEvent(input$run,{
myFuture <- future({
testMethod(value1, value2, value3, value4, zvtags)
})
then(myFuture, onFulfilled = function(value) {
shinyjs::enable("run")
output$loading <- renderUI("Done")
dataset = crunchdata(fbs, fbr, fas, far)
p_plt(pp(dataset$datast,input$before[1],input$before[2],input$after[1],input$after[2]))
p_tab(dataset$datatab)
},
onRejected = NULL)
return(NULL)
})
#The rest of the code irrelevant
})
Here is the python script for reference (calling another script)
cat python_ref.py
import ab_read_lhdb
def testMethod(time1, time2, time3, time4,lszv):
ab_read_lhdb.main(time1,time2,"rcvd",lszv)
#return ("before rcvd finished")
ab_read_lhdb.main(time1,time2,"srvd",lszv)
#return ("before srvd finished")
ab_read_lhdb.main(time3,time4,"rcvd",lszv)
#return ("after rcvd finished")
ab_read_lhdb.main(time3,time4,"srvd",lszv)
return ("LHDB Data pull finished")
Is there a way to make this work? Thank you!