We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50b9219 commit bb263a8Copy full SHA for bb263a8
src/content/docs/velocity/dev/api/event.md
@@ -126,7 +126,17 @@ or add a second return an [`Continuation`](jd:velocity:com.velocitypowered.api.e
126
```java
127
@Subscribe(priority = 100)
128
public void onLogin(LoginEvent event, Continuation continuation) {
129
- doSomeAsyncProcessing().addListener(continuation::resume, continuation::resumeWithException);
+ doSomeAsyncProcessing().whenComplete((_, throwable) -> {
130
+ if (throwable != null) {
131
+ continuation.resumeWithException(throwable);
132
+ } else {
133
+ continuation.resume();
134
+ }
135
+ });
136
137
+
138
+ private CompletableFuture<Void> doSomeAsyncProcessing() {
139
+ //...
140
}
141
142
0 commit comments