However, the underlying WebSocket connection can close at any time by a variety of factors including network instability or computer sleep mode. You must refresh the Shiny app to reconnect in these cases. There is a hard limit of 12 hours since the initial page load after which any connection, even if active, will be terminated. # Write an app that uses spark to access data on Databricks # First, install the following packages: install.packages (‘ future’ ) install.packages (‘ promises’ ) library ( shiny ) library ( promises ) library ( future ) plan ( multisession ) HEARTBEAT_INTERVAL_MILLIS = 1000 # 1 second # Define the long Spark job here run_spark % result () # Or: fut % result() busy ( 1 ) # Catch exceptions and notify the user fut <- catch ( fut, function ( e ) shinyApp ( ui = ui, server = server )
0 Comments
Leave a Reply. |