Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtificialPB committed Jan 27, 2025
1 parent a865714 commit 8d7e1ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal object AsyncExecutor {
val factory = MethodHandles.lookup().findVirtual(
threadBuilderClass,
"factory",
MethodType.methodType(ThreadFactory::class.java) // The method returns a ThreadFactory
MethodType.methodType(ThreadFactory::class.java), // The method returns a ThreadFactory
).bindTo(Thread::class.java.getMethod("ofVirtual").invoke(null))

// invoke while catching to see if we need to set "--enable-preview" flag
Expand All @@ -41,7 +41,7 @@ internal object AsyncExecutor {
lookup.findStatic(
Executors::class.java,
"newVirtualThreadPerTaskExecutor",
MethodType.methodType(ExecutorService::class.java)
MethodType.methodType(ExecutorService::class.java),
)
}.getOrNull()?.invokeExact() as? ExecutorService

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import org.jctools.queues.SpscUnboundedArrayQueue
import java.io.IOException
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.ThreadFactory
import java.util.concurrent.TimeUnit
import java.util.concurrent.locks.ReentrantLock
import java.util.function.Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ private class MappingRpcRequest<I, O, E : Result.Error, U : Result.Error>(
) : RpcRequest<O, U>() {
override fun sendAwait(): Result<O, U> = sendAsync().join()

override fun sendAsync(): CompletableFuture<Result<O, U>> =
request.sendAsync().thenApplyAsync(mapper, asyncExecutor())
override fun sendAsync(): CompletableFuture<Result<O, U>> = request.sendAsync().thenApplyAsync(mapper, asyncExecutor())

override fun batch(batch: BatchRpcRequest): CompletableFuture<Result<O, U>> {
return request.batch(batch).thenApplyAsync(mapper, asyncExecutor())
Expand All @@ -153,8 +152,7 @@ class SuppliedRpcRequest<T>(
) : RpcRequest<T, RpcError>() {
override fun sendAwait(): Result<T, RpcError> = supplier.get()

override fun sendAsync(): CompletableFuture<Result<T, RpcError>> =
CompletableFuture.supplyAsync(supplier, asyncExecutor())
override fun sendAsync(): CompletableFuture<Result<T, RpcError>> = CompletableFuture.supplyAsync(supplier, asyncExecutor())

override fun batch(batch: BatchRpcRequest): CompletableFuture<Result<T, RpcError>> {
return CompletableFuture.supplyAsync(supplier, asyncExecutor())
Expand All @@ -164,4 +162,3 @@ class SuppliedRpcRequest<T>(
return "SuppliedRpcRequest(supplier=$supplier)"
}
}

0 comments on commit 8d7e1ce

Please sign in to comment.