public interface MessageListener<Msg> extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
default <Source> CompletableFuture<Source> |
ask(Function<? super MessageListener<Source>,? extends Msg> messageProvider) |
default void |
close() |
static <Msg> MessageListener<Msg> |
create(String name,
Consumer<Msg> action) |
String |
getName() |
default <Source> CompletableFuture<Source> |
method_27918(Function<? super MessageListener<com.mojang.datafixers.util.Either<Source,Exception>>,? extends Msg> function) |
void |
send(Msg message) |
String getName()
void send(Msg message)
default void close()
close
in interface AutoCloseable
default <Source> CompletableFuture<Source> ask(Function<? super MessageListener<Source>,? extends Msg> messageProvider)
default <Source> CompletableFuture<Source> method_27918(Function<? super MessageListener<com.mojang.datafixers.util.Either<Source,Exception>>,? extends Msg> function)
static <Msg> MessageListener<Msg> create(String name, Consumer<Msg> action)