Understanding Shiny Server Execution Order

I'm suspicious that this question has been asked and answered before, but my search foo is failing me.

I'm relatively inexperienced with Shiny but not new to R. I'm trying to make sure I have a proper understanding of the order of operations of a Shiny app. When the app is started, are the UI and the Server in different R threads or are they run in the same thread? It feels like they are the same thread, maybe. But then I don't understand why in the examples libraries are loaded in BOTH the ui and the server...

If the ui and server are broken into different files, which is executed first? Or are they fired as the same time in different R threads?

Is there a document that explains this sort of internal business?

after some more searching I happened upon this article on scoping which really helped me a lot:


I think your link explains what you were asking. The ui renders the html document (which can be updated/modified via server functions) that's created first:

I asked Joe last year about whether "a document that explains this sort of internal business"/ code-map exists... maybe someone else has created one but they haven't.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.