Skip to content
Discussion options

You must be logged in to vote

You can do it like that

 @GET
    @Path("/eventloop")
    public Uni<RestResponse<String>> testEventLoop(){

        final var scheduler = ContextAwareScheduler.delegatingTo(Infrastructure.getDefaultWorkerPool()).withCurrentContext();

        return
                Uni
                        .createFrom()
                        .voidItem()
                        .invoke(() -> log.info("on the event loop"))
                        .emitOn(Infrastructure.getDefaultWorkerPool())
                        .map(_ -> {

                            log.info("on the executor thread");

                            //doing some blocking stuff
                            // ....

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@jponge
Comment options

Answer selected by ozzyozbourne
Comment options

You must be logged in to vote
1 reply
@jponge
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants