Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Wrong example usage of CompletableFututure's async methods #13

Open
@Bastian

Description

@Bastian

We have examples like this in the docs:

server.createTextChannelBuilder()
    .setName("new-channel")
    .create()
    .thenAcceptAsync(channel -> {
        // This code is already running async, so you can safely use join() here
        Message message = channel.sendMessage("First!").join();
        message.addReaction("👍").join();
    });

thenAcceptAsync(...) and other async methods use the ForkJoinPool.commonPool() by default. This pool is bound to the nuber of cpu cores and is not meant to be used for blocking operations.

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