Skip to content

Commit d5e64e6

Browse files
authored
Efficiency: promises method (#812)
* Use withCallingHandlers instead of tryCatch * Remove unneeded argument
1 parent fee83f5 commit d5e64e6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

R/req-promise.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,18 @@ req_perform_promise <- function(
106106
mock = mock
107107
)
108108
pooled_req$submit(pool)
109-
ensure_pool_poller(pool, reject)
109+
ensure_pool_poller(pool)
110110
})
111111
}
112112

113-
ensure_pool_poller <- function(pool, reject) {
113+
ensure_pool_poller <- function(pool) {
114114
monitor <- pool_poller_monitor(pool)
115115
if (monitor$already_going()) {
116116
return()
117117
}
118118

119119
poll_pool <- function(ready) {
120-
tryCatch(
120+
withCallingHandlers(
121121
{
122122
status <- curl::multi_run(0, pool = pool)
123123
if (status$pending > 0) {
@@ -135,7 +135,6 @@ ensure_pool_poller <- function(pool, reject) {
135135
},
136136
error = function(cnd) {
137137
monitor$ending()
138-
reject(cnd)
139138
}
140139
)
141140
}

0 commit comments

Comments
 (0)