Make CommandExecutionHandler#executeFuture return CompletableFuture<Void> instead of CompletableFuture<Object>
The value of the completed future is never used, void makes this more obvious
This commit is contained in:
parent
9e39b0ca8e
commit
a92ff9d39a
2 changed files with 6 additions and 5 deletions
|
|
@ -68,13 +68,14 @@ private class KotlinMethodCommandExecutionHandler<C>(
|
|||
context: CommandMethodContext<C>
|
||||
) : MethodCommandExecutionHandler<C>(context) {
|
||||
|
||||
override fun executeFuture(commandContext: CommandContext<C>): CompletableFuture<Any?> {
|
||||
override fun executeFuture(commandContext: CommandContext<C>): CompletableFuture<Void?> {
|
||||
val instance = context().instance()
|
||||
val params = createParameterValues(commandContext, commandContext.flags(), false)
|
||||
// We need to propagate exceptions to the caller.
|
||||
return coroutineScope
|
||||
.async(this@KotlinMethodCommandExecutionHandler.coroutineContext) {
|
||||
.async<Void?>(this@KotlinMethodCommandExecutionHandler.coroutineContext) {
|
||||
context().method().kotlinFunction?.callSuspend(instance, *params.toTypedArray())
|
||||
null
|
||||
}
|
||||
.asCompletableFuture()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue