Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server should send progress and busy messages to client #16

Closed
wch opened this issue Jan 11, 2022 · 1 comment · Fixed by #193
Closed

Server should send progress and busy messages to client #16

wch opened this issue Jan 11, 2022 · 1 comment · Fixed by #193

Comments

@wch
Copy link
Collaborator

wch commented Jan 11, 2022

Currently, pyshiny does not send busy and idle messages to the client.

Here's a log of the communication in R-shiny:

SEND {"config":{"workerId":"","sessionId":"da408435a4b00fe1731b0926eda7bc49","user":null}}
RECV {"method":"init","data":{"n:shiny.number":1,".clientdata_output_txt_hidden":false,".clientdata_pixelratio":2,".clientdata_url_protocol":"http:",".clientdata_url_hostname":"127.0.0.1",".clientdata_url_port":"7453",".clientdata_url_pathname":"/",".clientdata_url_search":"",".clientdata_url_hash_initial":"",".clientdata_url_hash":"",".clientdata_singletons":""}}
SEND {"busy":"busy"}
SEND {"recalculating":{"name":"txt","status":"recalculating"}}
SEND {"recalculating":{"name":"txt","status":"recalculated"}}
SEND {"busy":"idle"}
SEND {"errors":{},"values":{"txt":"input$n is 1"},"inputMessages":[]}
RECV {"method":"update","data":{"n:shiny.number":5}}
SEND {"progress":{"type":"binding","message":{"id":"txt"}}}
SEND {"busy":"busy"}
SEND {"recalculating":{"name":"txt","status":"recalculating"}}
SEND {"recalculating":{"name":"txt","status":"recalculated"}}
SEND {"busy":"idle"}
SEND {"errors":{},"values":{"txt":"input$n is 5"},"inputMessages":[]}

And a similar one in py-shiny:

SEND: {"config": {"workerId": "", "sessionId": "1", "user": null}}
RECV: {"method":"init","data":{"n":20,".clientdata_output_txt_hidden":false,
".clientdata_pixelratio":2,".clientdata_url_protocol":"https:",".clientdata_
url_hostname":"rstudio.github.io",".clientdata_url_port":"",".clientdata_url
_pathname":"/prism-experiments/app-b5nq8bxz2uydkuf2y7wk/",".clientdata_url_s
earch":"",".clientdata_url_hash_initial":"",".clientdata_url_hash":"",".clie
ntdata_singletons":""}}
SEND: {"recalculating": {"name": "txt", "status": "recalculating"}}
SEND: {"recalculating": {"name": "txt", "status": "recalculated"}}
SEND: {"errors": {}, "values": {"txt": "n*2 is 40"}, "inputMessages": []}
RECV: {"method":"update","data":{"n":49}}
SEND: {"recalculating": {"name": "txt", "status": "recalculating"}}
SEND: {"recalculating": {"name": "txt", "status": "recalculated"}}
SEND: {"errors": {}, "values": {"txt": "n*2 is 98"}, "inputMessages": []}
@cpsievert
Copy link
Collaborator

For future reference, the logic for the "binding progress" message is here https://github.com/rstudio/shiny/blob/78d77ce3733d947b292614a626e04ca5167aa445/R/shiny.R#L1306-L1323

cpsievert added a commit that referenced this issue Jun 8, 2022
…and output binding progress when an Output is recalculating
cpsievert added a commit that referenced this issue Jun 8, 2022
…and output binding progress when an Output is recalculating
cpsievert added a commit that referenced this issue Jun 8, 2022
…and output binding progress when an Output is recalculating
cpsievert added a commit that referenced this issue Jun 8, 2022
…and output binding progress when an Output is recalculating
cpsievert added a commit that referenced this issue Jun 13, 2022
…and output binding progress when an Output is recalculating
cpsievert added a commit that referenced this issue Jun 15, 2022
…and output binding progress when an Output is recalculating
cpsievert added a commit that referenced this issue Jun 15, 2022
…s when an Output is recalculating (#193)

* Close #185 and close #16: send busy/idle when an Effect is executing and output binding progress when an Output is recalculating

* Add mock _send_message method instead of checking for its existence

* Use the new _send_message_sync() method

* Show progress right as soon as output is invalidated

* Update tests/test_poll.py

Co-authored-by: Winston Chang <winston@stdout.org>

Co-authored-by: Winston Chang <winston@stdout.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants