generated from vertx-howtos/howto-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hi team,
Thanks for this howto instruction, it's very helpful as I'm also working on the vert.x based retry mechanism. I have a question about why you are using this to generate promise:
fun <T> executeFuture(
retry: Retry,
vertx: Vertx,
supplier: Supplier<Future<T>>,
): Future<T> {
val ctx = ContextInternal.current()
val promise = if (ctx != null) ctx.promise() else Promise.promise<T>()
AsyncRetryBlock(vertx, retry.asyncContext(), supplier, promise,).run()
return promise.future()
}
My guess is that you want this promise aware of current vertx context so any handlers attached to promise could be executed on the same context. But I wonder if it's a hard requirement? Will use promise created by Promise.promise<T>() break anything? Any suggestion? Thanks so much!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels