Skip to content

Commit

Permalink
Merge pull request #245 from atheriel/static-errorstream
Browse files Browse the repository at this point in the history
Avoids creating a new ErrorStream instance for each request
  • Loading branch information
wch authored Oct 1, 2019
2 parents a086ee2 + b1ae2f8 commit 57e1d71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
httpuv 1.5.2.9000
=================

* Avoid creating a new Rook error stream object for each request. This should improve performance. ([#245](https://github.com/rstudio/httpuv/pull/245))

httpuv 1.5.2
============

Expand Down
3 changes: 2 additions & 1 deletion R/httpuv.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ ErrorStream <- R6Class(
),
cloneable = FALSE
)
stdErrStream <- ErrorStream$new()

#' @importFrom promises promise then finally is.promise %...>% %...!%
rookCall <- function(func, req, data = NULL, dataLength = -1) {
Expand All @@ -102,7 +103,7 @@ rookCall <- function(func, req, data = NULL, dataLength = -1) {

req$rook.input <- inputStream

req$rook.errors <- ErrorStream$new()
req$rook.errors <- stdErrStream

req$httpuv.version <- httpuv_version()

Expand Down

0 comments on commit 57e1d71

Please sign in to comment.