Skip to content

Discussion #1

@rul124

Description

@rul124

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions