title: R Shiny Two Outputs for One Action Button
body: <p>I'm trying to use an action button in R Shiny to start a slow-running JAGS model. I would like some text to appear when the user first hits the button that displays what time they pressed the button so that they know something is happening. </p>
  
  <p>So far, the action button is working but it waits until the slow-running model is done to display both the model output and the text. </p>
  
  <p>I have looked at the following questions but they don't seem to answer my question, at least not in a way I understand:
   <a href="https://stackoverflow.com/questions/35039736/r-shiny-execute-order">R Shiny execute order</a> 
  <a href="https://stackoverflow.com/questions/44958394/pattern-for-triggering-a-series-of-shiny-actions">Pattern for triggering a series of Shiny actions</a></p>
  
  <p>I am new to Shiny so I'm hoping this is a simple problem. </p>
  
  <pre><code>Run.me &lt;- function(a){
  # some fake slow function
  # This actually takes about 8 hours in real life 
  
  for (i in 2:a) {
  Foo[i] &lt;&lt;- Foo[i-1] + sample(1:20,1)
  }}
  
  library(shiny)
  </code></pre>
  
  <h1>Define server logic ----</h1>
  
  <pre><code>server &lt;- function(input, output) {
  
  observeEvent(input$runmodel, {
  output$model.running &lt;- renderText({paste("Model started at", Sys.time())})
  })
  
  observeEvent(input$runmodel, {
  Foo &lt;&lt;- rep(1, 1e6)
  Run.me(1e6)
  output$model.ran &lt;- renderTable({head(Foo)})
  })
  
  }
  </code></pre>
  
  <h1>Define UI ----</h1>
  
  <pre><code>ui &lt;- fluidPage(
  
  fluidRow(
  column(5, align = "center",
         actionButton("runmodel", "Run the Model")),
  textOutput("model.running")
  ),
  
  
  fluidRow(
  column(5, align = "center", tableOutput("model.ran"))
  )
  )
  </code></pre>
  
  <h1>Run the app ----</h1>
  
  <pre><code>shinyApp(ui = ui, server = server)
  </code></pre>