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

Add support for returning promises from endpoints #248

Merged
merged 25 commits into from
Feb 26, 2019
Merged

Conversation

trestletech
Copy link
Contributor

@trestletech trestletech commented Mar 30, 2018

TODO:

  • support filters returning promises, at which point we promote the rest of the calls into a promise chain?
  • tests
  • docs
  • NEWS update
  • httpuv version dependency update

@codecov-io
Copy link

codecov-io commented Mar 30, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@331a9ea). Click here to learn what that means.
The diff coverage is 97.24%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #248   +/-   ##
=========================================
  Coverage          ?   89.41%           
=========================================
  Files             ?       28           
  Lines             ?     1568           
  Branches          ?        0           
=========================================
  Hits              ?     1402           
  Misses            ?      166           
  Partials          ?        0
Impacted Files Coverage Δ
R/default-handlers.R 100% <100%> (ø)
R/plumber-step.R 88.37% <96.42%> (ø)
R/plumber.R 84.1% <97.02%> (ø)
R/async.R 97.84% <97.84%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 331a9ea...6711539. Read the comment docs.

@kahuna-blake
Copy link

Are promises/a-sync processing supported in plumber yet?

I somehow need to have a-sync processing on Google App Engine/Flex with a docker container. I looked into docker-compose and docker swarm, but it does not appear GAE supports those yet.

@kahuna-blake
Copy link

Are promises/a-sync processing supported in plumber yet?

I somehow need to have a-sync processing on Google App Engine/Flex with a docker container. I looked into docker-compose and docker swarm, but it does not appear GAE supports those yet.

After some searching, I found that https://github.com/dselivanov/RestRserve supports concurrent connections. I really like the simplicity of plumber, but until it can handle multiple requests, I can't use it in a production environment.

@schloerke schloerke added this to the v0.4.8 - Next CRAN release milestone Dec 7, 2018
@shrektan
Copy link
Contributor

shrektan commented Feb 1, 2019

Any future plans on this? It would be great to have concurrent connections.

@schloerke
Copy link
Collaborator

@shrektan Yes! This is definitely on our radar. I am really pushing for this to happen before the next CRAN release.

R/async.R Outdated Show resolved Hide resolved
R/async.R Show resolved Hide resolved
R/plumber-step.R Outdated Show resolved Hide resolved
R/plumber.R Outdated Show resolved Hide resolved
* master:
  use rtools within appveyor (#381)
* master:
  Remove the Date header as httpuv does this automatically now (#380)
* Non-working wip with promise domain based forwarding

* clean up code

* reset forwarding at the beginning of a handle or mounts within a route call

* if a filter has forwarded, return like normal, otherwise copy the serializer
* promises:
  remove debug error message and add comment
* promises:
  fix how `runHooks` handles promises
bounce errors up until they are handled
* wrap inside of runStep with a while(TRUE) to avoid recursion for sync execution

* allow for looping by returning x in the try catch of the sync loop

* formatting and comment

* Add many comments. Call init runStep in tryCatch. (simplifies inner sync tryCatch / error handling)
R/plumber.R Outdated Show resolved Hide resolved
@schloerke schloerke added the QA Submitted for QA label Feb 22, 2019
@schloerke schloerke merged commit e22e4b0 into master Feb 26, 2019
@schloerke schloerke deleted the promises branch February 26, 2019 14:52
schloerke added a commit that referenced this pull request Feb 26, 2019
* master:
  Add support for returning promises from endpoints (#248)
  use httpuv url encode / decode (#355)
  Add support for serializer parameters in plumber block (#356)
schloerke added a commit that referenced this pull request Mar 19, 2019
* master:
  add serializer_rds and serializer_rds3 (#387)
  Support around non-ASCII key values in query string (#396)
  update host from 0.0.0.0 to 127.0.0.1 (and [::] to [::1]) for swagger url only (#376)
  Add support for returning promises from endpoints (#248)
  use httpuv url encode / decode (#355)
  Add support for serializer parameters in plumber block (#356)
This was referenced Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA Submitted for QA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants