Closed RLesur closed 5 years ago
I don't mind renaming even if await
is clear about the purpose even if you don't know JS. I understand it as await for the async task, the promise, to be resolved
I would says that wait
or wait_for
bear the same meaning. hold
is ok I guess.
Does adding a delay means that it cover the timeout
wrapper idea (#21) ?
await
is clear enough, but I think that for people knowing JS, this would be highly confusing.
We still have a wait()
function, that is the reason why I was looking for another name.
A delay
argument would be a shorthand for hold(promise %>% timeout2(delay))
. The timeout2()
idea in #21 is still useful.
I regret the name I gave to the
await()
function.In JS,
await
is a keyword that can only be used inside anasync
function (anasync
function is a function that always returns a promise). Usingawait
outside anasync
function is illegal. I think that makes sense.Here, the
await()
function is a wrapper overlater::run_now()
. For instance, the httpuv package also wrapslater::run_now()
with thehttpuv::service()
function.I think we should rename the
await()
function. The only proposal I have would behold(promise)
. We could add adelay
argument here:hold(promise, delay = 30)
.